3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $video_url = '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 OPaer
Output for 4.3.0 - 7.1.0
http://http://google.com