PHP Programing language

How can create a program to combine arrays
Previous Home Next
<html>
<head>
<title>Combining Arrays</title>
</head>
<body>
<?php 
$colors = array('red', 'yellow', 'green'); 

$flavors = array('apple', 'banana', 'lime'); 

$tastes = array('sweet', 'sour');

$prices = array();

$name = 'lemon'; 

$arrays = array('name' => $name, 'prices' =>
$prices, 'flavors' => $flavors); 

foreach($arrays as $key => $value) { 
    if($fruits = @array_combine($colors, $value)) 
        printf("<pre>%s</pre>\n", var_export($fruits, TRUE)); 
    else 
        printf("<p>Couldn't combine \$colors and \$%s.</p>",
		$key); 
} 
?>
<body>
</body>
</html>

 

Output:

Previous Home Next

Tolal:0 Click:

Show All Comments

Did not find what you were looking for leave your name and message. We will revert within 24 hours
Name:
eMail:
Comment / Feedback: