note 44773 modified in function.array-pop by vrana

From: Date: Tue, 17 Aug 2004 14:48:05 +0000
Subject: note 44773 modified in function.array-pop by vrana
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-79832@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). <?php $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 --was-- 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 http://php.net/manual/en/function.array-pop.php

« previous php.notes (#79832) next »