iam*_*rus 1 php
我有一个PHP数组,其父级称为"项目".在该数组中,我想删除所有不包含字符串的值(我将使用正则表达式来查找).我该怎么做?
Nad*_*adh 5
foreach($array['items'] as $key=>$value) { // loop through the array if( !preg_match("/your_regex/", $value) ) { unset($array['items'][$key]); } }
归档时间:
14 年,2 月 前
查看次数:
287 次
最近记录: