3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $paths = array( 'invalid path', 'http://myhost.com/image.jpg', 'https://mysslhost.com/image.jpg', ); foreach ($paths as $path) { $is_full_path = 0 !== preg_match('@^http:\/\/@', $path); echo sprintf("'%s' %s is a full path.\n", $path, ($is_full_path ? 'YES' : 'NO')); }
based on D5kUF
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
'invalid path' NO is a full path. 'http://myhost.com/image.jpg' YES is a full path. 'https://mysslhost.com/image.jpg' NO is a full path.