Tutorial PHP – Mengambil Nilai dari Array.

Bagaimana Untuk Mengambil Nilai dari Array?

Anda dapat mengambil nilai dari array menggunakan ekspresi elemen array $array[$key].

Berikut ini adalah contoh script PHP:

<?php $languages = array(); $languages["Zero"] = “PHP”; $languages["One"] = “Perl”; $languages["Two"] = “Java”; print(“Array with inserted values:\n”); print_r($languages); ?>

Script ini akan mencetak:

Array with default keys:
The second value: Perl

Array with specified keys:
The third value: Java

Leave a Reply

Your email address will not be published. Required fields are marked *


*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>


Fatal error: Cannot redeclare smartadapt_setup() (previously declared in /home/tutorial/domains/belajarweb.net/public_html/wp-content/themes/smartadapt/functions.php:33) in /home/tutorial/domains/belajarweb.net/public_html/wp-content/themes/smartadapt/footer.php on line 86