3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = '<p>hello<a href="https://www.youtu.be/watch?v=7HknMcG2qYo">world</a></p><p>hello<a href="https://youtube.com/watch?v=37373o">world</a></p>'; $pattern = '/https?:\/\/(www\.)?youtu(\.be|\com)\/[a-zA-Z0-9\?=]*/i'; preg_match_all($pattern, $html, $matches); // print_r($matches); $first_found_youtube = $matches[0][0]; echo $first_found_youtube;
Output for git.master, git.master_jit, rfc.property-hooks
https://www.youtu.be/watch?v=7HknMcG2qYo

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
153.16 ms | 405 KiB | 5 Q