3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $video_url = 'http://google.com'; $needles = array('http://', 'https://'); // Normalise the URLs foreach ($needles as $needle) { if (strpos($video_url, $needle) !== 0) { $video_url = 'http://' . $video_url; } } echo $video_url;
based on U4Im3
Output for 4.3.0 - 7.2.0
http://http://google.com