3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = "Hello, http://jsfiddle.net/uyuouyvz/ this is a test for jsfiddle.net"; $preg = "%(http://(www.)?[jsfiddle].net/\w+?(/\d+)?(/.*)?)%im"; $text = preg_replace_callback($preg, function($match) { return "<iframe src=\"{$match[0]}\"></iframe>"; }); echo $text;

preferences:
52.87 ms | 402 KiB | 5 Q