3v4l.org

run code in 300+ PHP versions simultaneously
<!DOCTYPE html> <html> <head><title>some title</title></head> <body> <form method="post" action=""> <input type="text" name="something"/> <input type="submit" value="click" name="submit" /> </form> <?php if(isset($_POST['submit'])) { $text = $_POST ['something']; $replaced = preg_replace('#https://www\.youtube\.com/watch\?v=(\w+)[^\s]+#i','<iframe width="853" height="480" src="http://www.youtube.com/embed/$1" frameborder="0" allowfullscreen></iframe>',$text); echo $replaced ; } ?> </body> <html>

preferences:
32.83 ms | 402 KiB | 5 Q