PHP: replace string from a particular string to a particular string

ammar_shahin

New Member
How can I replace a string from a particular string? Please see my example below.\[code\]$string_value="http://stackoverflow.com/questions/3899143/<b>Man one</b> <img src=/"http://www.abc.com/image1.jpg\">and <b>Man two</b> <img src=http://stackoverflow.com/"http://www.abc.com/img2.png\">";\[/code\]Now my expected out put is = \[code\]<b>Man one</b> and <b>man two</b>.\[/code\] only the image tag should be deleted.So I have to cut the full string from \[code\]"<img"\[/code\] to \[code\]">"\[/code\] from string $string_value.So how can I cut the full string between \[code\]"<img"\[/code\] to \[code\]">"\[/code\] using preg_replace or anything else.The replacing parameter should be blank space.
 
Back
Top