Re: get size of variable n bytes
| From: | David Nicholson | Date: | Wed, 16 Jul 2003 14:31:12 +0000 |
| Subject: | Re: get size of variable n bytes | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-155431@lists.php.net to get a copy of this message | ||
Hello,
This is a reply to an e-mail that you wrote on Wed, 16 Jul 2003 at 14:52,
lines prefixed by '>' were originally written by you.
> Hi List
> Sorry, tried to find it in manual...
> I'd like to query a db and and see how big the result is in bytes. How
> can I do that?
> Thanks
One way would be to assume that 1 character takes 1 byte to store so...
$sizeinbytes = strlen($field);
Obviously the amount of disk space that your database server takes to
store the field is going to vary from this so if you need to know that
exact value you will have to look for a function within your database that
will calculate it for you.
HTH,
David.
--
phpmachine :: The quick and easy to use service providing you with
professionally developed PHP scripts :: http://www.phpmachine.com/
Professional Web Development by David Nicholson
http://www.djnicholson.com/
QuizSender.com - How well do your friends actually know you?
http://www.quizsender.com/
(developed entirely in PHP)