3v4l.org

run code in 300+ PHP versions simultaneously
<?php $paths = array( 'invalid path', '/relative/path/image.jpg', 'http://myhost.com/image.jpg', 'https://mysslhost.com/image.jpg', ); foreach ($paths as $path) { $is_full_path = 0 !== preg_match('@^http(s)?:\/\/@', $path); echo sprintf("'%s' %s is a full path.\n", $path, ($is_full_path ? 'YES' : 'NO')); }

preferences:
36.07 ms | 402 KiB | 5 Q