![]() |
Output is correct. when input is To get |
<?php
$url = 'http://test.google.co.uk';
$info = parse_url($url);
$pieces = explode(".", $info['host']);
$len = strlen($pieces[1]); // returns character length of google = 6
echo $len;
?>
Category: | Web Tutorial |
Sub Category: | PHP Domain Tutorial |
Uploaded by: | Admin |
Read Articlehttps://horje.com/learn/1434/reference