hi dear i am having trouble with follwing statement. if the string contains \ then print slash but it don't work.
Lookup preg_match on PHP.net. That's the function you'll need to use since \ is a special regex character.
If I understand right, your problem is that you want to output the character "\" in PHP. but, PHP uses the \ to escape characters, so if you want to output a "\" you need to escape it with a \ ex: //to output the string "go to C:\Windows\Fonts to find arial" then it would be as follows: echo 'go to C:\\Windows\\Fonts to find arial'; PHP: