Hello,
I'm trying to replace the "%20" (space) from the query string with " " but my page just keeps blowing up when I use str_replace(). I have directories which contain photos of houses and I need the name of the directories to have spaces as they are also used for display purposes. However, when "%20" shows up in the query string it blows up the page and nothing is displayed. I tried running it through str_replace() to replace the "%20" but this doesn't work either.
function get_imgarr()
{
$rpa = $_GET['pa'];
$pa = str_replace("%20", " ", $rpa);
var_dump($pa);
if(!valid_propadd($pa))
die("invalid property address!");
else
$propadd = $pa;
$userfolder = $_SESSION['valid_user'];
$dir = get_imgdir();
$files = @scandir($dir);
foreach($files as $value) {
// check for image files
if(valid_image_file($value))
// build image array
$imgarr[] = $value;
}
return $imgarr;
}
Any ideas?
Thanks,
Jason