-7
  1. 从数组中读取文件名。
  2. 在数组值中搜索字符串“-dep”,如果任何字符串值包含“-dep”,则将其删除。
  3. 将数组作为值传递给另一个数组

.

for($d=0; $d < $files; ++$d)
{
    if(strpos($files[$d], "-dep") === true)
    {
      unset($files[$d]);
    }
}
return array($dnum, $fnum, $dirs, $files);
4

2 回答 2

2

You can do this with array_filter

于 2013-05-01T18:39:40.833 回答
0

I don't know if it is the best method for doing so but I would do this

foreach($array as $key=$value)
{
    if(strstr($value, '-dep'))
        unset($array[$key]);
}
于 2013-05-01T18:39:49.290 回答