3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $text = '<div id="_ftn88"> <p class="FootnoteText" style="text-align:left"> <a href="#_ftnref88"><span class="FootnoteReference" style="font-family:\'Times New Roman\'; font-size:8pt">[88]</span></a><span style="font-family:\'Times New Roman\'; font-size:10pt"> </span><span style="width:7.86pt; text-indent:0pt; display:inline-block"></span><span style="font-family:\'Times New Roman\'; font-size:10pt">At 96.</span> </p> </div>'; preg_replace_callback( "/<p(.*?)>(.*?)<\/p>/s", "replaceMatches", $text); function replaceMatches($matches) { // as usual: $matches[0] is the complete match // $matches[1] the match for the first subpattern // enclosed in '(...)' and so on $matches[2] = str_replace('span', 'strong', $matches[2]); return $matches; }
based on etR01
Output for 5.3.19 - 5.6.28, 7.0.20, 7.1.5 - 7.2.0
Notice: Array to string conversion in /in/pM3hT on line 13
Output for 7.0.0 - 7.0.6, 7.1.0
Notice: Array to string conversion in /in/pM3hT on line 12