jueves, 12 de abril de 2012

Array Basics


Example 4-1. Creating arrays
// An array called $vegetables with string keys

$vegetables['corn'] = 'yellow';

$vegetables['beet'] = 'red';

$vegetables['carrot'] = 'orange';



// An array called $dinner with numeric keys

$dinner[0] = 'Sweet Corn and Asparagus';

$dinner[1] = 'Lemon Chicken';

$dinner[2] = 'Braised Bamboo Fungus';



// An array called $computers with numeric and string keys

$computers['trs-80'] = 'Radio Shack';

$computers[2600] = 'Atari';

$computers['Adam'] = 'Coleco';

No hay comentarios:

Publicar un comentario