<?php $directory="img"; $dirint = dir($directory); while (($archivo = $dirint->read()) !== false) { if (eregi("gif", $archivo) || eregi("jpg", $archivo) || eregi("png", $archivo)){ echo '<img src="'.$directory."/".$archivo.'">'."<br/>"; } } $dirint->close();?>
Standard input is empty
Standard output is empty
PHP Warning: dir(img): failed to open dir: No such file or directory in /home/CrY68p/prog.php on line 4 PHP Fatal error: Call to a member function read() on boolean in /home/CrY68p/prog.php on line 5
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!