我有以下数组,我想检索name
, comment
and each of the tags
(插入数据库。我如何检索数组值。另外,我可以仅过滤大于 3 个字符且仅包含 a-Z0-9 值的标签值吗?非常感谢。
Array
(
[folder] => /test
[name] => ajay
[comment] => hello world.. test comment
[item] => Array
(
[tags] => Array
(
[0] => javascript
[1] => coldfusion
)
)
)
$name = $array['name'];
$comment = $array['comment'];
$tags = $array['item']['tags']; // this will be an array of the tags
然后您可以循环遍历标签,例如:
foreach ($tags as $tag) {
// do something with tag
}
或者单独访问每一个
echo $tags[0];
echo $tags[1];
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)