I have problem when replace char \ to / here my code:
$loc = str_replace('\','/',$loc);
but that code error:
Parse error: syntax error, unexpected '>' in /
I have problem when replace char \ to / here my code:
$loc = str_replace('\','/',$loc);
but that code error:
Parse error: syntax error, unexpected '>' in /
You need to escape the backslash:
$loc = str_replace('\\','/',$loc);
See also:
Do I need to escape backslashes in PHP?