I have string
$text = "this is my text";
and i want to know the size(byte), not text length.
so i tried to use
filesize();
but i get Error
Warning: filesize(): stat failed for this is my text
and if i tried to use
mb_strlen()
it only count the text lenght, not the size.
How to know the text size ? i want the result something like “1024 bytes”
Thanks
in your case byte length is the same as string length. use
strlenlike so:or if you want to be complicated use: