3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function replaceSingleQuotesInsideTags( $input ) { $output = preg_replace('/<[^>]*>/e', "str_replace(\"'\", \"\\\"\", '$0')", $input); echo $output; } replaceSingleQuotesInsideTags("On <A href=\"/home/' target='_self'>this</Apage you will find <SPAN STYLE='font-style: italic'>stuff</SPAN>"); ?>
based on jcQXX
Output for 7.0.0 - 7.3.0alpha1
Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /in/mQqtr on line 5
Output for hhvm-3.15.4
On <A href=\"/home/" target="_self">this</Apage you will find <SPAN STYLE="font-style: italic">stuff</SPAN>
Output for 5.6.0 - 5.6.30
Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /in/mQqtr on line 5 On <A href=\"/home/" target="_self">this</Apage you will find <SPAN STYLE="font-style: italic">stuff</SPAN>