Array
(
[Jobs] => Array
(
[0] => 3
[1] => 4
[2] => 5
[3] => 6
[4] => 7
)
)
How can I combine them together based on the key to create
Array
(
[0] => Array
(
[Job] => 3
[Percent] => 28
)
[1] => Array
(
[Job] => 4
[Percent] => 39
)
[2] => Array
(
[Job] => 5
[Percent] => 17
)
........ and so on for each
)
<?
// clean it up
$jobs = $yourjobs['Jobs'];
$pcts = $yourpcts['Percent'];
// make a counter
$i=0;
// loop thru jobs array
foreach($jobs as $value)
{
$newarray[] = array("Job"=>$value,
"Percent"=>$pcts[$i]);
++$i; // increment $i
}
// debug
?><pre><?
print_r($newarray[]);
?></pre><?
?>
I know dirty 8 )
--
------------------------------------
The Developer Network
http://thedevnet.com