What Will Be The Output Of The Following Php Codep Pre Langphp #42
What will be the output of the following PHP code?</p> <pre><code class="language-php" line="1"> <?php $fname = array("Peter", "Ben", "Joe"); $age = array("35", "37", "43"); $c = array_combine($age, $fname); print_r($c); ?> </code></pre>
This multiple choice question (MCQ) is related to the book/course gs gs107 PHP: Hypertext Preprocessor. It can also be found in gs gs107 PHP Array - PHP Array - Quiz No.2.
What will be the output of the following PHP code?
<?php $fname = array("Peter", "Ben", "Joe"); $age = array("35", "37", "43"); $c = array_combine($age, $fname); print_r($c); ?>
Array (Peter Ben Joe)
Array ([Peter] => 35 [Ben] => 37 [Joe] => 43)
Array (35 37 43)
Array ([35] => Peter [37] => Ben [43] => Joe)