Home Tutorial Php List PHP list array keys

 
 

PHP list array keys
Posted on: October 31, 2009 at 12:00 AM
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 )

Related Tags for PHP list array keys:


Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.