Nov 12
If you are a PHP programmer and if you are using regular expressions with ereg_replace then often with replacing particular characters you might encounter error like
Warning: ereg_replace(): REG_BADRPT
Here is a simple function that causes this error
function OrigURL($str)
{
$out = ereg_replace('+',' ',$str);
return $out;
}
Solution: Just escape the characters. Only then it will work.
$out = ereg_replace(’\+’,’ ‘,$str);
Hope this would help!

















Recent Comments