3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $xml = '<set1> <uid1>Line 1 Line 2 Line 3 Line 4 </uid1> <uid20>Line 1 Line 2 Line 3 Line 4 </uid20> </set1> <set2> <uid1>Line 1 Line 2 Line 3 Line 4 </uid1> <uid20>Line 1 Line 2 Line 3 Line 4 </uid20> </set2>'; $xml = preg_replace('/<uid1>([\n])<\/uid1>/', 'dee', $xml); //preg_match('/<uid1>#([\n])<\/uid1>/', $file, $match); echo $xml;
based on Xitn4
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.3.0rc3
<set1> <uid1>Line 1 Line 2 Line 3 Line 4 </uid1> <uid20>Line 1 Line 2 Line 3 Line 4 </uid20> </set1> <set2> <uid1>Line 1 Line 2 Line 3 Line 4 </uid1> <uid20>Line 1 Line 2 Line 3 Line 4 </uid20> </set2>