Senin, 15 Desember 2014

PHP ARRAY

<?php
    $shopping=array(1=>"bag","umbrella","hat","tie","car");
    echo "<h3>";
    echo $shopping[1]. "<br>";
    echo $shopping[2]. "<br>";
    echo $shopping[3]. "<br>";
    echo $shopping[4]. "<br>";
    echo $shopping[5]. "<br>";
    $shopping[]="Lemon Tea";
    echo $shopping[6]. "<br>";
    echo "Jumlah Elemen ada:" .count($shopping)."<br>";
    echo "</h3>";
    for($X=1;$X<=count($shopping);$X++)
    {
        echo $shopping[$X]."<br>";
    }
?>

Tidak ada komentar:

Posting Komentar