$flr = preg_replace("/\\\'/","%27",$flr);
If url has this symbol: ‘ it got replaced by %27 and url should become http://localhost/%27
But this doesn’t work. For example:
$flr = preg_replace("/\\\"/","%22",$flr);
url replacment works and i get http://localhost/%22
Then why first example doesn’t work ?
To test i’m using:
function isValidFLR(&$flr) {
$flr = preg_replace("/\\\'/","%27",$flr);
$flr = preg_replace("/\\\"/","%22",$flr);
echo $flr;
die();
}
will work.
But, as others have said, one of the PHP functions which does this could be a better solution.