1$array = array(
2 1 => 'apple',
3 2 => 'banana',
4)
5
6// Method 1
7echo "<pre>";
8print_r($array);
9echo "</pre>";
10
11// Method 2
12echo "<pre>";
13var_dump($array);
14echo "</pre>";
15
16// Method 3 (cakephp)
17pr ($array);
1<?php
2$cars = array("Volvo", "BMW", "Toyota");
3echo "I like " . $cars[0] . ", " . $cars[1] . " and " . $cars[2] . ".";
4?>