This is a discussion on Using Arrays in PHP within the PHP Programming forums, part of the Web Development category; HI, What is the difference of using count() and sizeof() in counting array values?...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| Well, there's no difference at all. Sizeof() is an alias of Count(). |
| |||
| Hi Explizite, There is some difference there, just check it below, They can both be used to count the number of items in an array but does one do it better? sizeof vs count sizeof: 3.75928902626 seconds count: 3.33035206795 seconds Time saved: 0.428936958313 seconds; 12.8796280262% The evidence says yes. The count function was over 12% faster in this test. Both functions are fast though taking 3-4 microseconds to count an array with 100,000 items. You might think it isn't worth it but remember count is also a character shorter. Not only is it faster to run but it is also faster to type!
__________________ Thanks & Regards Sabari... |
| |||
| array_push array_push -- Push one or more elements onto the end of array Example: array_push() $stack = array ("orange", "banana"); array_push ($stack, "apple", "raspberry"); This example would result in $stack having the following elements: Array ( [0] => orange [1] => banana [2] => apple [3] => raspberry ) |
![]() |
| Thread Tools | |
| Display Modes | |
| |
LinkBacks (?)
LinkBack to this Thread: http://www.discussweb.com/php-programming/3298-using-arrays-php.html | |||
| Posted By | For | Type | Date |
| mrajendhran's bookmarks tagged with | This thread | Refback | 08-30-2007 12:04 PM |
| DiscussWeb IT Community - Technical Support and Technology Discussions | This thread | Refback | 08-23-2007 09:11 AM |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Classic asp arrays and recordset | ramesh123 | ASP and ASP.NET Programming | 1 | 12-02-2007 07:44 PM |
| Using arrays in stored procedures | oxygen | Database Support | 1 | 11-26-2007 07:01 AM |
| Arrays in Java | leoraja8 | Java Programming | 7 | 11-19-2007 12:23 AM |
| Jagged Arrays in C# | vigneshgets | C# Programming | 3 | 08-23-2007 12:13 AM |
| Java:Tutorial - Arrays | pranky | Java Programming | 0 | 02-23-2007 11:54 PM |