I am having problems with the str_ireplace() function. I know how it works, I’ve it in been using it in the past, but for some reason things aren’t working now, and I can’t find out why.
The URL of the page I made is here:
I have been getting the value of QID through $_GET() That works fine, and I can echo it onto the page, it will display {1.816.2.6} just like it’s supposed to.
Then I tried to implement a replace function to strip the { } tags. First it looked like this:
[CODE]
<?php
$QID = $_GET[“QID”];
echo “$QID<br />”;
$Brackets=array(“{“,”}”);
$Strip=””;
$Q=str_ireplace($Brackets,$Strip,$QID);
echo “$Q<br />”;
?>
This would kill my script, and my page would be blank.
So I tried just a basic replace() function, copied and pasted straight from W3Schools examples, so I KNOW it is 100% correct script syntax.
The full src of the PHP file looks like this:
[CODE]
<?php
echo str_ireplace(“WORLD”,”Peter”,”Hello world!”);
?>
This shows up as a blank page on my browser when it should show up as “Hello Peter!”
What’s going on? Why does all my other PHP stuff work, but not ireplace()?