Thursday, 20 September 2012

Solution How replace slach in PHP

You can replace '\' with '/' and '/' with '\' in PHP

replace \ with /
echo str_replace('\\','/','Hi\Mi');
output: Hi/Mi

replace / with \
echo str_replace('/','\\','Hi/Mi');  
output: Hi\Mi

Share This!

No comments:

Post a Comment

Here We Write The Problems we face at different situations and Solutions to those problems.