0

hi, 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!

2
Contributors
6
Replies
7
Views
5 Years
Discussion Span
Last Post by Virangya
0

try this

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

try this

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

thanks for your reply, but i what to escape too..

0

i don't get it, why would you escape double quotes(") when it's not even conflicting with your string statement, you wrap them with single quotes, not double quotes that would cause conflict that's why you had to escape them

0

i don't get it, why would you escape double quotes(") when it's not even conflicting with your string statement, you wrap them with single quotes, not double quotes that would cause conflict that's why you had to escape them

yeah you makes sense. i was the one who messed it up in my head :D. thanks!

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.