Re: Re: Array sizes?
| From: | Paul Novitski | Date: | Wed, 08 Feb 2006 09:27:38 +0000 |
| Subject: | Re: Re: Array sizes? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-230074@lists.php.net to get a copy of this message | ||
Anders Norrbring wrote:
At 01:05 AM 2/8/2006, Barry wrote:Maybe I'm just blind, but I can't find any way to count an array size in bytes? I have a quite big array with multiple data formats in it, and I would like to know how big it is in bytes...
I don't think a "function" exists, but i would probably use (for benchmarking) a recursive foreach in combination with strlen. And add it all up. (This is probably some work for the PC so that's why benchmarking)It would be interesting to know whether that method was faster or slower than using this:
$iLen = strlen(implode("", $aArray));
Paul