History of PHP
Version 1: 1994
Version 2: 1995
Personal Home Page Tools
Version 3: 1998
PHP:Hypertext Preprocessor
Version 4: 2000
-rewrite,powered by Zend Engine 1
Version 5: 2004
-powered by Zend Engine 2
-better performance
-improved OOP
Server-side Vs Client-side Scripting languages.
echo "I am " . $ nationality [0] . "my neighbour is " . $ nationality [1] . " and
" . $ nationality [2] . ".";
?>
Example2(Associative arrays):
<?php
$stno=array("abc"=>"35","xyz"=>"37","mno"=>"43");
echo "I am in " . $stno['abc'] . " Street.";
?>
These arrays in php has got some in built/predefined functions to perform some
complex tasks very easily. As PHP is very popular and well known for its rich
set of functions. Here is the list of functions applicable for use with arrays.
Function
array()
array_change_key_
case()
array_chunk()
array_column()
array_combine()
array_count_values
()
array_diff()
array_diff_assoc()
array_diff_key()
array_diff_uassoc()
Description
Creates an array
Changes all keys in an array to lowercase or
uppercase
Splits an array into chunks of arrays
Returns the values from a single column in the
input array
Creates an array by using the elements from one
"keys" array and one "values" array
Counts all the values of an array
Compare arrays, and returns the differences
(compare values only)
Compare arrays, and returns the differences
(compare keys and values)
Compare arrays, and returns the differences
(compare keys only)
Compare arrays, and returns the differences
(compare keys and values, using a user-defined
key comparison function)
array_diff_ukey()
array_shift()
extract()
in_array()
key()
krsort()
ksort()
list()
natcasesort()
natsort()
next()
pos()
prev()
range()
reset()
rsort()
shuffle()
sizeof()
sort()
uasort()
uksort()
usort()
element
Imports variables into the current symbol table
from an array
Checks if a specified value exists in an array
Fetches a key from an array
Sorts an associative array in descending order,
according to the key
Sorts an associative array in ascending order,
according to the key
Assigns variables as if they were an array
Sorts an array using a case insensitive "natural
order" algorithm
Sorts an array using a "natural order" algorithm
Advance the internal array pointer of an array
Alias of current()
Rewinds the internal array pointer
Creates an array containing a range of elements
Sets the internal pointer of an array to its first
element
Sorts an indexed array in descending order
Shuffles an array
Alias of count()
Sorts an indexed array in ascending order
Sorts an array by values using a user-defined
comparison function
Sorts an array by keys using a user-defined
comparison function
Sorts an array using a user-defined comparison
function