Presentation is loading. Please wait.

Presentation is loading. Please wait.

Pemrograman Web Dasar Pertemuan 12 PHP Array. Indexed arrays - Arrays with numeric index Associative arrays - Arrays with named keys Multidimensional.

Similar presentations


Presentation on theme: "Pemrograman Web Dasar Pertemuan 12 PHP Array. Indexed arrays - Arrays with numeric index Associative arrays - Arrays with named keys Multidimensional."— Presentation transcript:

1 Pemrograman Web Dasar Pertemuan 12 PHP Array

2 Indexed arrays - Arrays with numeric index Associative arrays - Arrays with named keys Multidimensional arrays - Arrays containing one or more arrays PHP Array

3 Sama seperti C++ index dimulai dari 0 Pengaksesan array berdasarkan indexnya PHP Indexed Array

4 Mengakses Server <?php $x1 = 2; $x2 = 3; $x3 = 4; echo $x1,$x2,$x3; ?> PHP Indexed Array

5 <?php $x = array(1,2,3); echo $x[0]; echo $x[1]; echo $x[2]; ?> Indexed Array

6 <?php $x[0] = 1; $x[1] = 2; $x[2] = 3; echo $x[0]; echo $x[1]; echo $x[2]; ?> Indexed Array

7 "; } ?> Indexed Array

8 Pengaksesan array menggunakan key age=array("Peter"=>"35","Ben"=>"37","Joe"=>"43"); $age['Peter']="35"; $age['Ben']="37"; $age['Joe']="43"; Associative Array

9 "35","Ben"=>"37","Joe"=>"43" ); foreach($age as $x=>$x_value) { echo "Key=". $x. ", Value=". $x_value; echo " "; } ?> Associative Array

10 Multidimensional Array

11 SEKIAN


Download ppt "Pemrograman Web Dasar Pertemuan 12 PHP Array. Indexed arrays - Arrays with numeric index Associative arrays - Arrays with named keys Multidimensional."

Similar presentations


Ads by Google