Motivation

Used to store several values in one variable. Say you need to store your contacts.

contacts = array (‘paula’,’maria’, ‘bob’ );

Adding elements to existing array

$carribean = array("RD", "Jamaica", "Colombia");
$carribean[] = "Cuba"; 
echo count($carribean ); // 4

PHP Associative Arrays

<?php
$pop = array("brazil"=>200, "portugal"=>10, "angola"=>40);
echo json_encode($pop);
?>

Result:

{"brazil":200, "portugal":10, "angola":40}