I am unable to find out why i am getting weird results.
Here is the code
$string = 'i bought this in hundred dollars';
$patterns = '/hundred dollars/';
$replace = '$100';
$result=preg_replace($patterns, $replace, $string);
echo $result;
//The above example will output
i bought this in 0
while i am expecting to replace 'hundred dollars' with $100 why i am getting 0 in the results.
Hope some body will explain me.
thanks