yes - another url check thread, but I couldn't find any thread for exactly my question.
if $url starts with 'http://' or 'www.', $urlCheck should return as true, else as false;
Code: Select all
$url = 'http://test.com';
if(preg_match('/(http:\/\/|www.)/i', $url)) {
$urlCheck = true;
} else {
$urlCheck = false;
}