3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = ' <foo>ciao</foo> <i>ex</i> <asd>boh</asd> <i>ex </i> <i> testo con spazi </i> <i>boh</i> <asd>boh</asd> '; $string = preg_replace('#<i>(.+)([\s]+)</i>#', '<i>\1 :)</i>', $string); echo $string;

preferences:
45.39 ms | 402 KiB | 5 Q