I'm trying to change some parts of a string. I used preg_replace() function for this stuation but I couldn't succeed.
Here is an example.
$str = "Suspendisse rutrum rhoncus leo vitae vehicula. <span class="sdsad"> Nunc nec dapibus nisi.</span> Donec facilisis mauris sapien, eget blandit enim dignissim auctor. <span style="text-decoration: underline;" class="sadsad">Nullam a porta orci.</span>";
I need to get parts begin with "<span" and after all till ">" charecter and turn it <p> or something else.
$str = preg_replace('/<span.*>/', '<p>', $str);
I'm trying to solve this like that but it returns the same value.
What do I need to do this ?
Thank you..