I'm using CKEDITOR for saving html content. After saving the html to the database, my image source isn't correct for display. For example I save the following html code to database:
HELLO WORLD<br \/>
\n\n<hr \/>\n
<img alt=\"\" src=\"http:\/\/localhost\/MM\/uploads\/1370293869_toranj.jpg\"
style=\"height:244px; width:201px\" \/><br \/>\n
The src must be like below:
src=\"http://localhost/MM/uploads/1370293869_toranj.jpg\"
I want to remove \
from src starting from http
to end of src url.
UPDATE:
after any try with str_replace
and preg_replace
i can use this below code for remove \
from src and replace /
width \
for create correct image src to displage
echo str_replace('\\','/', preg_replace('/\/+/i', '', $html));