kkreft
2/27/2014 - 1:55 PM

PHP prase url

$parsed = parse_url($urlStr);
if (empty($parsed['scheme'])) {
    $urlStr = 'http://' . ltrim($urlStr, '/');
}