Download presentation
Presentation is loading. Please wait.
Published byNestor Choyce Modified over 9 years ago
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
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.