note 102752 deleted from function.array-merge by danbrown

From: Date: Thu, 03 Mar 2011 19:15:35 +0000
Subject: note 102752 deleted from function.array-merge by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-177539@lists.php.net to get a copy of this message
Note Submitter: Thomas Shearer ---- <?php $amountOfArrays = count( $someArrays ); $mergedArray = Array(); for( $i=0; $amountOfArrays; $i++ ) { $mergedArray = array_merge( $mergedArray, $someArrays[$i] ); } ?> This is not correct and results in an infinite loop. It should be: <?php $amountOfArrays = count( $someArrays ); $mergedArray = Array(); for( $i=0; $i<$amountOfArrays; $i++ ) { $mergedArray = array_merge( $mergedArray, $someArrays[$i] ); } ?>

« previous php.notes (#177539) next »