Is strlen = size in bytes also ?
Posted: Tue Jan 10, 2006 5:33 am
Code: Select all
$contents = @file_get_contents($url);
$Total_Size = strlen($contents);Thanks
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
$contents = @file_get_contents($url);
$Total_Size = strlen($contents);Code: Select all
<?php
$filename = 'http://google.com';
echo $filename . ': ' . filesize($filename) . ' bytes';
?>Maybe they should make it clearer? I honestly hadn't considered it before now... Its almost automatic to assume it means the number of letter - not bytes. Which makes it interesting given the attached comments in relation to UTF-8.Returns the length of the given string.