You can initialize Numeric Arrays like this also,

Code: PHP
$names = array();
$names[] = 'Pradeep';
$names[] = 'Shabbir';
$names[] = 'Manindar Poddar';
// PHP will automatically set the index
 

You can print associative arrays like this,

Code: PHP
$ages['John'] = "32";
$ages['Paul'] = "30";
$ages['Steve'] = "34";

//using sprintf or printf
printf("John is %d years old",$ages['John']);

// or this way
print("John is {$ages['John']} years old");
Scripting like this