Share on Google+Share on Google+

PHP list array keys

Advertisement
In this part of the tutorial we will learn about the function array_keys in context of list in PHP. And we will also see the example related to the array_keys() function

  • array_keys() function returns the keys of the the given array.
  • It returns the keys in the form of array.


Example of PHP list Array Keys

<?php
    $ar1
=array("x"=>"x-mas","y"=>"yak","zebra");
    $key
=array_keys($ar1);
    print_r($key);
?>

   Output
   Array ( [0] => x [1] => y [2] => 0 )

Advertisements

Posted on: October 31, 2009 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Share this Tutorial Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.