@ 2014-03-13T13:43:12Z <?php
$urls = array(
'http://www.website.com/path1/path2/file1.php?query1=true&query2=false',
'http://website.com/path1/path2/file1.php?query1=true&query2=false',
'http://website/path1/path2/file1.php?query1=true&query2=false',
'http://www.website.com/path1/path2/?query1=true&query2=false',
'http://website.com/path1/path2/?query1=true&query2=false',
'http://website/path1/path2/?query1=true&query2=false',
'http://www.website.com/path1/path2/',
'http://website.com/path1/path2/',
'http://website/path1/path2/',
'http://www.website.com?query1=true&query2=false',
'http://website.com?query1=true&query2=false',
'http://website?query1=true&query2=false',
'www.website.com/path1/path2/file1.php?query1=true&query2=false',
'website.com/path1/path2/file1.php?query1=true&query2=false',
'website/path1/path2/file1.php?query1=true&query2=false',
'www.website.com/path1/path2/?query1=true&query2=false',
'website.com/path1/path2/?query1=true&query2=false',
'website/path1/path2/?query1=true&query2=false',
'www.website.com/path1/path2/',
'website.com/path1/path2/',
'website/path1/path2/',
'www.website.com?query1=true&query2=false',
'website.com?query1=true&query2=false',
'website?query1=true&query2=false',
);
$flags = array(
'none' => null,
'scheme' => FILTER_FLAG_SCHEME_REQUIRED,
'scheme + host' => FILTER_FLAG_SCHEME_REQUIRED & FILTER_FLAG_HOST_REQUIRED,
'scheme + host + path' => FILTER_FLAG_SCHEME_REQUIRED & FILTER_FLAG_HOST_REQUIRED & FILTER_FLAG_PATH_REQUIRED,
'scheme + host + path + query' => FILTER_FLAG_SCHEME_REQUIRED & FILTER_FLAG_HOST_REQUIRED & FILTER_FLAG_PATH_REQUIRED & FILTER_FLAG_QUERY_REQUIRED,
'host' => FILTER_FLAG_HOST_REQUIRED,
'host + path' => FILTER_FLAG_HOST_REQUIRED & FILTER_FLAG_PATH_REQUIRED,
'host + path + query' => FILTER_FLAG_HOST_REQUIRED & FILTER_FLAG_PATH_REQUIRED & FILTER_FLAG_QUERY_REQUIRED,
'path' => FILTER_FLAG_PATH_REQUIRED,
'path + query' => FILTER_FLAG_PATH_REQUIRED & FILTER_FLAG_QUERY_REQUIRED,
'query' => FILTER_FLAG_QUERY_REQUIRED
);
foreach($urls as $url){
foreach($flags as $k => $flag){
echo "$url => $k :\r\n";
var_dump((bool) filter_var($url, FILTER_VALIDATE_URL, $flag));
}
echo "\r\n";
}
Enable javascript to submit You have javascript disabled. You will not be able to edit any code.
Output for git.master , git.master_jit , rfc.property-hooks Fatal error: Uncaught Error: Undefined constant "FILTER_FLAG_SCHEME_REQUIRED" in /in/NmNEI:31
Stack trace:
#0 {main}
thrown in /in/NmNEI on line 31
Process exited with code 255 . This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.
Active branches Archived branches Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page
preferences:dark mode live preview
38.53 ms | 401 KiB | 8 Q