PHP array_flip() Function
Complete PHP Array Reference
Definition and Usage
The array_flip() function returns an array with all the original keys as values, and all original values as keys.
Syntax
Parameter |
Description |
array |
Required. Specifies an array |
Example
<?php
$a=array(0=>"Dog",1=>"Cat",2=>"Horse");
print_r(array_flip($a));
?>
|
The output of the code above will be:
Array ( [Dog] => 0 [Cat] => 1 [Horse] => 2 )
|
Complete PHP Array Reference
Learn XML with <oXygen/> XML Editor - Free Trial!
|
|
oXygen helps you learn to define,
edit, validate and transform XML documents. Supported technologies include XML Schema,
DTD, Relax NG, XSLT, XPath, XQuery, CSS.
Understand in no time how XSLT and XQuery work by using the intuitive oXygen debugger!
Do you have any XML related questions? Get free answers from the oXygen
XML forum
and from the video
demonstrations.
Download a FREE 30-day trial today!
|
|