how can i REPLACE back slash in my string (file path) with forward slash. please help.

str_replace doesnt seem to be working!

Recommended Answers

All 3 Replies

$newphrase = str_replace('\\', '/', $phrase);

worked like a charm!!

Hey grt.. it was magic

you can also use preg_replace

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.