I have made the following code in a PHP file to list the content of a directory
and it works just fine
<?php
$dir = opendir(getcwd());
while (($file = readdir($dir)) !== false) {
echo "filename : ". $file ."<br />";
}
closedir($dir);
?>
I want to make some changes in the output (string) result. I have tried a search and replace PHP code str_replace() but I have been unable to get it to work.
You can try the following