为什么在此代码中使用array_pop()? [英] why array_pop() used in this code?
本文介绍了为什么在此代码中使用array_pop()?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我认为不需要在下面的代码中使用它.
i think there is no need to use this , in below code .
<?
$slides =array();
//$filePath='directorypath/';
$dir = opendir($directory1);
while ($file = readdir($dir)) {
if (eregi("\.png",$file) || eregi("\.jpg",$file) || eregi("\.gif",$file) ) {
$slides[] = $file;
}
}
while (sizeof($slides) != 0 ){
$img = array_pop($slides);
echo '<li>';
echo "<img src='$directory1/$img' />";
}
?>
推荐答案
幻灯片 = array(); //
slides =array(); //
filePath ='directorypath/';
filePath='directorypath/';
dir = opendir(
dir = opendir(
这篇关于为什么在此代码中使用array_pop()?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文