note 44773 added to function.array-pop

From: Date: Mon, 16 Aug 2004 09:43:25 +0000
Subject: note 44773 added to function.array-pop
Groups: php.notes 
Request: Send a blank email to php-notes+get-79798@lists.php.net to get a copy of this message
I am not sure if this is the best way, but I could not find a way to clear an array so I used array_pop to do it for me. Use it at your own risk :) Assume $taskTimes is an existing array that you want to reuse (say inside a while loop). $sizeA = sizeof($taskTimes); while ($sizeA > 0) { array_pop($taskTimes); $sizeA--; } I am not a php guru...actually a Java guru getting by with php ... elf ---- Manual Page -- http://www.php.net/manual/en/function.array-pop.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+44773 Delete -- http://master.php.net/manage/user-notes.php?action=delete+44773&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+44773&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#79798) next »