- preg_match: documentation ( source)
<?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 $path . ' ' . ($is_full_path ? 'YES' : 'NO') . ' is a full path' . PHP_EOL;
}