Jump to content

How to put things into double array?


ted_chou12

Recommended Posts

How do you put things into double array?

an array looks like:

array("test" => "go", "go" => "test");

what about when you want to put things for foreach? so:

foreach(...) {
$array[] = $string1 => $string2;
}
//this wouldnt work, but single array:
foreach(...) {
$array[] = $string1;
}
//works

Can anyone help me get it right for the double array please?

Thanks

Ted

Link to comment
https://forums.phpfreaks.com/topic/38048-how-to-put-things-into-double-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.