I have a string coming from database as given below. I want to change the img src in the text below to be ./upload-files/<filename>
instead of ../upload-files/<filename>
.
<p><span style="text-decoration: line-through;">
<img style="float: left; margin-left: 5px; margin-right: 5px;" src="../upload-files/teddybear.jpg">
</span></p>
So basically I want image to use the current directory instead of the parent directory ../
How can i do this? Is preg_replace the right tool here?