array_merge : array_merge « Data Structure « PHP






array_merge

 
<?php

$face = array("J","Q","K","A");
$numbered = array("2","3","4","5","6","7","8","9");
$cards = array_merge($face, $numbered);
shuffle($cards);
print_r($cards);

?>
  
  








Related examples in the same category

1.Appending One Array to Another
2.Using array_merge() and the + operator with associative arrays as well
3.array_merge( ) function combines two or more arrays by renumbering numerical indexes and overwriting string indexes
4.array_merge( ) retains array keys when possible.
5.array_merge() and + operator
6.array_merge() example
7.array_merge() function merges 1 to N arrays together
8.obtaining the union of two arrays