- 从数组中读取文件名。
- 在数组值中搜索字符串“-dep”,如果任何字符串值包含“-dep”,则将其删除。
- 将数组作为值传递给另一个数组
.
for($d=0; $d < $files; ++$d)
{
if(strpos($files[$d], "-dep") === true)
{
unset($files[$d]);
}
}
return array($dnum, $fnum, $dirs, $files);
You can do this with array_filter
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]);
}