Example:
HTML
<?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;
?>
How to count domain length in PHP | PHP Domain Tutorial |
How to get domain extension from php string | PHP Domain Tutorial |
How to get Domain http request info in PHP | PHP Domain Tutorial |
Type: | Html |
Category: | Web Tutorial |
Sub Category: | PHP Domain Tutorial |
Uploaded by: | Admin |