You are on page 1of 6

Pemograman : PHP Dasar (Array

Sabtu, 12 Mei 2012 | Penjaga Gudang di 21.16 | Label: Komputer,Pemograman, PHP

Array adalah variabel khusus, yang dapat menyimpan beberapa nilai dalam satu variabel tunggal. Array terdiri dari Numeric Arrays, Associative Arrays dan Multidimensional Arrays. Untuk penjelasanya ada dibawah ini:

Numeric Arrays

Numeric Arrays adalah sebuah array yang menyimpan setiap elemen array dengan menggunakan indeks numerik. Contoh: $tekologi=array("motor","komputer","lampu","pesawat"); atau bisa juga $tekologi[0]="motor"; $tekologi[1]="komputer"; $tekologi[2]="lampu"; $tekologi[3]="pesawat"; Note : Angka pertama Numeric Array adalah 0 (nol) untuk contoh yang lebih jelas, bisa dilihat dibawah ini: <?php $tekologi[0]="motor"; $tekologi[1]="komputer"; $tekologi[2]="lampu"; $tekologi[3]="pesawat"; echo $tekologi[0] . " lalu " . $tekologi[1] . " teknologi yang bagus."; ?> Maka hasil dari script diatas adalah: motor lalu komputer teknologi yang bagus

Associative Arrays

Berbeda dengan dengan Numeric Arrays, yaitu Associative Arrays indeksnya tidak menggunakan numerik, tetapi dengan nama/teks. Contoh: $nilai = array("Rious"=>70, "Reito"=>80, "Ujang"=>50); atau bisa juga

Contoh: $families = array ( "Ibu"=>array ( "Kakaku".  Multidimensional Arrays Dalam Multidimensional Arrays. "Paman"=>array ( "KeponakanA". "Saya". untuk contoh yang lebih jelas. bisa dilihat dibawah ini: <?php $nilai['Rious'] = "70". atau bisa juga Array ( [Ibu] => Array ( [0] => Kakaku [1] => Saya [2] => Adikku ) [Bibi] => Array .$nilai['Rious'] = "70". echo "Nilai Rious adalah " . $nilai['Ujang'] = "50".". $nilai['Ujang'] = "50". "KeponakanB" ) ). "Bibi"=>array ( "Keponakan" ). "Adikku" ). $nilai['Reito'] = "80". $nilai['Reito'] = "80". " point. array utama mempuyai anak array dan dari anak array terdapat array lain dan seterusnya. ?> Maka hasil dari script diatas adalah: Nilai Rious adalah 70 point. $nilai['Rious'] .

" Salah satu keluarga saya?". Unsourced material may be challenged and removed. $families['Bibi'][0] . (March 2010) Contents [hide] .html Top 10 Hot PHP Frameworks 1 Yii (148 votes) discuss Yii discuss CodeIgniter discuss CakePHP discuss Zend discuss Symfony 2 CodeIgniter (117 votes) 3 CakePHP (83 votes) 4 Zend (75 votes) 5 Symfony (56 votes) 6 PHPDevShell (42 votes) 7 Prado (28 votes) 8 Akelos (24 votes) 9 ZooP (5 votes) 10 QPHP (5 votes) discuss Prado discuss Akelos List of PHP editors From Wikipedia. Please help improve this article by adding citations to reliable sources.blogspot. Maka hasil dari script diatas: Apakah keponakan Salah satu keluarga saya? http://rumah-menyenangkan. This article needs additional citations for the free encyclopedia This article contains a list of text editors with features specific to the PHP scripting language.( [0] => Keponakan ) [Paman] => Array ( [0] => KeponakanA [1] => KeponakanB ) ) Untuk mencetak array diatas bisa menggunakan script seperti dibawah ini: echo "Apakah " .

Open-source. free project. 1 Free editors o o o o    1.4 Yes Yes Bluefis h GNU General Public License Yes Yes Yes Yes Yes ? Yes Yes Yes Yes Komodo Edit Mozilla Public License Yes Yes Yes ? Yes ? Yes 8.1 Cross-platform 1. and SMB. Aptana Studio – Eclipse-based IDE.5. With GVFS. . etc. FTP. supports SFTP.4. visual JS editor.4 Linux 2 Commercial editors 3 External links 4 References Free editors[edit] Ma c OS X Intern al Browse r Versio n Contro l Edito r License Window s Linu x Other platfor ms Code Completi on GUI builde r syntax highlight er last versio n Dual License Aptana Studio Aptana Public License.  Bluefish – A multipurpose editor with PHP syntax support.2 Yes Yes Netbean s Yes Yes Yes JVM Yes ? Yes 7.2 Windows 1.1/GPL v2 Yes Yes Yes JVM Yes ? Yes 3. (Community edition merged in). in-line PHP documentation.3 Yes No Cross-platform[edit]   Koding – Free online development environment for many programming languages including PHP. WebDAV. able to use PDT plugins.3 Mac OS X 1.0 GNU General Public License Dual License CDDL 1. v1.0 / LGPLv2.

HTML-Kit – Syntax highlighting. C# and JavaScript and publishing through WebDeploy andFTP. supports FTP. debugging. PHP. powerful config via Lua API. Windows[edit]        Kantharos PHP IDE – Fast & handy freeware editor. CVS. server and publishing environment. syntax highlighting for HTML. Supports SFTP and FTP. With additional plugins supports SVN.  Komodo IDE – Cross-platform integrated development environment for PHP as well as Python. Eclipse – PHPEclipse and PHP Development Tools projects. Vim – provides PHP syntax highlighting. provides built in debugger and class explorer.2 and powerful plugin support for added functionality. Supports multiple file encodings as of version 2. syntax highlighting. Syntax highlighting and (partial) code completion for PHP + HTML and other IDE-like features like code browser etc.js. code validation. PHP syntax highlighting. The major mode web-mode.     SciTE – fast. jEdit – Versatile free/open source editor. Trac integration. The nXhtml addon has special support for PHP (and other template languages). debugger. ConTEXT – *No longer under development* Freeware editor with syntax highlighting. compiler integration. and others.[1] Sublime Text – Free for evaluation IDE. node.    Notepad2 – Simple editor with syntax highlighting Notepad++ – Supports FTP & SFTP via plugin.    Geany – Syntax highlighting for HTML + PHP. database modelling.  Emacs – Advanced text editor.  Netbeans – A dedicated PHP coding environment and complete integration with web standards. Supports SFTP and FTP. database navigation. Komodo Edit – General purpose scripting language editor with support for PHP. Codelobster – Free editor with syntax highlighting. supports FTP. Supports FTP. Full support for SVN and Git since 7. Provides PHP function list. The Black Toolkit – RAD tool for Visual programming in many languages. Microsoft WebMatrix – A combined editor. Razor. Alleycode HTML Editor – Shareware editor with syntax highlighting for both PHP and HTML.  Editra – Versatile open source editor. SSH/FTP access. PHPEdit – Complete IDE for PHP . Free version of the commercial ActiveState Komodo IDE. Crimson Editor – Lightweight editor. Ruby and Perl.el is designed for editing mixed HTML templates.

Linux[edit]     gedit gPHPEdit Kwrite Kate – Supports any protocol that is supported by KIO. syntax highlighting. RJ TextEd – Feature rich text editor with many great features Sublime 2 Mac OS X[edit]     TextWrangler – Supports SFTP and FTP TextMate Smultron Sublime Text – Free for evaluation text editor. http://en. This includes HTTP. .   KDevelop – Supports everything as Kate above with addition of references of functions and syntax parser.    Programmer's Notepad PSPad – Supports FTP. Sublime Text – Free for evaluation IDE. SMB and WebDAV.wikipedia. SSH.