Jump to content

array()


dreamwest

Recommended Posts

Im trying to specify keys for associative arrays but ive never done it before other than via mysql

 

This:

 

	$srt = 1;
$end = 10;
while ($srt < $end) {

$arr[]= $srt;
++$srt;		
}//end while	
print_r ($arr);

 

Outputs: (10 loops)

Array ( [0] => 1 [1] => 2 [2] => 3 [3] => 4 [4] => 5 [5] => 6 [6] => 7 [7] => 8 [8] => 9 )

 

But how can i get it like this: (1 loop example)

Array ( [0] => Array ( [q_id] => 1 [q_v_id] => 857434 [q_session] => fe13c9e53d1e6d0170a59f88c6327547 ) )

 

Link to comment
https://forums.phpfreaks.com/topic/206593-array/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.