Avatar of willsherwood
willsherwood

asked on 

PHP array question

I have an inherited script that has the loop:

      
while($row = mysql_fetch_array($result)) {
		$result_array[] = $row;
	}
         foreach ($result_array as $result) {
        ... }

Open in new window


what is the benefit of splitting this seemingly common/conventional (mysql results) loop into two loops?
and doesn't the first loop just copy the array, row by row?
PHP

Avatar of undefined
Last Comment
Dave Baldwin

8/22/2022 - Mon