Can someone explain what is wrong with this code?
$string = "blabla <'bl'a'> hello";
$result = preg_replace( "#<'([^'>]\S+)'>#", "'" . $this->escape_string( "$1" ) . "'", $string );
What this is supposed to do is to pick the text inside <' and '> and do a mysql_real_escape_string ($this->escape_string) to that text.
It is displaying the $string correctly, without the < and > but escape_string isn't working. It's supposed to return blabla 'bl\'a' hello instead of blabla 'bl'a' hello.
I have also tried to use the function strtoupper instead of $this->escape_string but it is still not working.
Any ideas?