separator - Replacing a specific character in php -


i have variable having path file following:

$path = "\home\ashutosh\desktop\imgdone\0001.jpeg" 

i want \ replaced / in order me read path. have used str_replace() function replace php code not able recognize that.

str_replace( "\", "/", $path ); 

please help

you need escape \ : str_replace('\\', '/', $path);

i explain bit : "\" tell php not end @ quote follow \.

you use in case : "hello i'm \"the cat\", super hero". \ special char, used escape 1 follow. if want use it, need escape himself : \\


Comments

Popular posts from this blog

routing - AngularJS State management ->load multiple states in one page -

python - GRASS parser() error -

json - Gson().fromJson(jsonResult, Myobject.class) return values in 0's -