Belajar PHP (2)
Belajar SQL (3)
Ekonomi (0)
Ilmuan Islam (1)
Olahraga (1)
Politik (0)
Teknologi (1)





















Selasa, 11 Oktober 2011 - 15:25:16 WIB
PHP array() -1
Diposting oleh : Administrator
Kategori: Belajar PHP - Dibaca: 106 kali


Defenisi dan Fungsinya

array() menciptakan sebuah array, dengan key dan value. jika engkau melewatkan sebuah key ketika engkau menetukan sebuah array, sebuah integer key terbentuk, mulai dari 0 dan meningkat 1 untuk setiap nilainya.

Syntax

array(key => value)

ParameterDescription
keyOptional. Specifies the key, of type numeric or string. If not set, an integer key is generated, starting at 0
valueRequired. Specifies the value


Example 1

<?php
$a=array("a"=>"Dog","b"=>"Cat","c"=>"Horse");
print_r($a);
?>

The output of the code above will be:

Array ( [a] => Dog [b] => Cat [c] => Horse )


Example 2

<?php
$a=array("Dog","Cat","Horse");
print_r($a);
?>

The output of the code above will be:

Array ( [0] => Dog [1] => Cat [2] => Horse )


0 Komentar :


Isi Komentar :
Nama :
Website :
Komentar
 
 (Masukkan 6 kode diatas)

 


Langganan RSS





/ /


Februari, 2012
MSSR KJS
   1234
567891011
12131415161718
19202122 232425
26272829   




007474

Pengunjung hari ini : 12
Total pengunjung : 3358

Hits hari ini : 25
Total Hits : 7474

Pengunjung Online: 5



Pilih Browser Favorit Anda?

Internet Explorer
Mozilla Firefox
Google Chrome
Opera

Lihat Hasil Poling







Nama :
Website :
Pesan