This site is mobile accessible. Press the "Tap Here" button to use a different font-size.


Smartphone icons created by Freepik - Flaticon

PHP Arrays

array_combine() Function

Array ( [Peter] => 35 [Ben] => 37 [Joe] => 43 )

<?php
// the 2 arrays to combine
$fname=array("Peter","Ben","Joe");
$age=array("35","37","43");

// combine both arrays and display the contents of the new array
$c=array_combine($fname,$age);
print_r($c);
?>