1

I've been trying to solve this but no luck. This is my code.

       $replace1 =str_replace('hreflang=\"'.$arr['variantslang1hid'].'\"     lang=\"'.$arr['variantslang1hid'].'\"','hreflang=\"'.$arr['variantslang1'].'\" lang=\"'.$arr['variantslang1'].'\"',$replace1);

It should replace but no. I'm not escaping "" properly. How can i solve this? Help much appreciated!

guitarlass
  • 1,587
  • 7
  • 21
  • 45

1 Answers1

2

if you use single quotes, you don't need to escape double quotes, '"' is what you want.

miki
  • 695
  • 3
  • 8
  • 2
    to elaborate, in single quoted strings, you only need to escape single quotes, and in double quoted strings, you only need to escape double quotes. – dqhendricks Feb 22 '12 at 04:51