note 32172 added to function.array-push
| From: | hem at hwzone dot com | Date: | Mon, 19 May 2003 14:47:42 +0000 |
| Subject: | note 32172 added to function.array-push | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-48594@lists.php.net to get a copy of this message | ||
I have used a lot of array_push function in a piece of code and found it very slow. The code below
works many times faster (I am using PHP 4.3.2-RC1@Win32).
$array[(count($array)+1)]=$value;
----
Manual Page -- http://www.php.net/manual/en/function.array-push.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+32172
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+32172&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+32172&report=yes