- substr: documentation ( source)
- mb_strlen: documentation ( source)
- htmlspecialchars: documentation ( source)
- file: documentation ( source)
<?php
$_POST['sitename'] = 'http://google.com';
if(substr($_POST['sitename'], 0, 4) == "http") {
$url = $_POST['sitename'];
$lines = file($url);
foreach($lines as $line_num => $line) {
//echo "Line #<b>{$line_num}</b> : " . htmlspecialchars($line) . "<br />\n";
$countsym = htmlspecialchars($line);
echo 'strlen = ' . mb_strlen($countsym, 'utf-8') . '<br>';
}
}