I need to make an associated array (all with the same key name) using values
from another array. Is there a more efficient way to doing this in one pass
(instead of looping)?
I'm always looking to learn something new. :-)
--------------------------------------------------------------------
$fields = array('username ', 'passwd', 'firstname', 'lastname', 'email');
foreach ($fields as $field_entry)
{
$list[] = array( 'field_name' => $field_entry);
}
from another array. Is there a more efficient way to doing this in one pass
(instead of looping)?
I'm always looking to learn something new. :-)
--------------------------------------------------------------------
$fields = array('username ', 'passwd', 'firstname', 'lastname', 'email');
foreach ($fields as $field_entry)
{
$list[] = array( 'field_name' => $field_entry);
}
Comment