3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = '<html> <head> <etc /> </head> <body> <div><img src="blah.jpg" /></div><br /> </body> </html>'; $regex = '#<img .*?\/>#'; preg_match($regex, $html, $matches); var_dump($matches[0]);

preferences:
32.87 ms | 405 KiB | 5 Q