【发布时间】:2013-04-25 19:25:09
【问题描述】:
- 从数组中读取文件名。
- 在数组值中搜索字符串“-dep”,如果任何字符串值包含“-dep”,则将其删除。
- 将数组作为值传递给另一个数组
.
for($d=0; $d < $files; ++$d)
{
if(strpos($files[$d], "-dep") === true)
{
unset($files[$d]);
}
}
return array($dnum, $fnum, $dirs, $files);
【问题讨论】:
-
4.问题是什么?
-
$d < $files应该是$d < count($files) -
和
strpos应该检查>= 0因为它返回第一个匹配的索引。 -
对不起,问题在标题中。我不知道这是不可接受的。
-
想知道为什么这个问题被否决了吗?