i am newbie in php i find this code want to convert in php function <?php //path to directory to scan $directory = "./list/"; //get all image files with a .jpg extension. $images = glob($directory . "*.jpg"); //print each file name foreach($images as $image) { echo $image.'<br/>'; } ?> PHP:
<?php function doSomething() { //path to directory to scan $directory = "./list/";//get all image files with a .jpg extension. $images = glob($directory . "*.jpg"); //print each file name foreach($images as $image) { echo $image.'<br/>'; } } ?> PHP: