<?php

error_reporting(-1);

$regexp = '!^htt(p|ps)://([^\s]+){3}$|(^$)!';

$correctNumber = array(
    'http://wt_import(filename)',
    'https://1232145',
    'http://eom',
    'https://content-available-to-author-only.html#465723',
    '',
);

$wrongNumber = array(
    'http://example com with     many spaces',
    ' https://2...content-available-to-author-only.....contenttml#465723',
    'http, http://, example.com',
    'http://ex',
    'http://',
    'l',
    ' http:// ',
    'https:// ',
    'https:// DF',
    ' ',
    '  ',
    '  ',
    '   ',
    '    ',
    '     ',
    '      ',
    '       ',
    '          ',
    '            ',
    '      sdfsdf      ',
    'sdfsdf      sdfsdf      ',
    'qeqweqw',
    '            ',
);

echo "TRUE\n\n";

foreach ($correctNumber as $number) {
    if (preg_match($regexp, $number)) {
        echo "[+] \"{$number}\"\n";
    } else {
        echo "[-] \"{$number}\"\n";
    }
}

echo "\nFALSE\n\n";

foreach ($wrongNumber as $number) {
    if (preg_match($regexp, $number)) {
        echo "[+] \"{$number}\"\n";
    } else {
        echo "[-] \"{$number}\"\n";
    }
}
