Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
How To Create an Array
How To Create an Array? - PHP Script Tips - Understanding PHP Arrays and Their Basic Operations
✍: FYIcenter.com
You can create an array using the array() constructor. When calling array(), you can also initialize the array with pairs of keys and values. Here is a PHP script on how to use array():
<?php print("Empty array:\n"); $emptyArray = array(); print_r($emptyArray); print("\n"); print("Array with default keys:\n"); $indexedArray = array("PHP", "Perl", "Java"); print_r($indexedArray); print("\n"); print("Array with specified keys:\n"); $mappedArray = array("Zero"=>"PHP", "One"=>"Perl", "Two"=>"Java"); print_r($mappedArray); print("\n"); ?>
This script will print:
Empty array: Array ( ) Array with default keys: Array ( [0] => PHP [1] => Perl [2] => Java ) Array with specified keys: Array ( [Zero] => PHP [One] => Perl [Two] => Java )
2007-04-20, 4843👍, 0💬
Popular Posts:
The object that contains all the properties and methods for every ASP.NET page, that is built is .. ...
What will be printed as the result of the operation below: main() { int x=10, y=15; x = x++; y = ++y...
Can you explain what is “AutoPostBack” feature in ASP.NET ? If we want the control to automatically ...
How To Compare Two Strings with strcmp()? - PHP Script Tips - PHP Built-in Functions for Strings PHP...
What is a measure in OLAP ? Measures are the key performance indicator that you want to evaluate. To...