PHP Programing language

R4R® PHP
(追記) (追記ここまで)
(追記) (追記ここまで)
array_keys() Function in PHP
(追記) (追記ここまで)
(追記) (追記ここまで)

array_keys()

The array_keys() function returns an array containing the keys.

Syntax:
array_keys(array,value,strict)

In above syntax,"array" specifies an array, "value" specifies the value then only the keys with this value are returned, "strict" is used with the value parameter and values are as follows:

  • true - Returns the keys with the specified value, depending on type: the number 5 is not the same as the string "5".
  • false - Default value. Not depending on type, the number 5 is the same as the string "5".

Example:

<?php
$a=array("Apple"=>"fruit","Mango"=>"fruit","Banana"=>"fruit");
print_r(array_keys($a));
?>

Output:

Array ( [0] => Apple [1] => Mango [2] => Banana )

(追記) (追記ここまで)
Copyright ©2021-22 r4r.co.in, all rights reserved. Theguestspost.com
Sitemap
Career
Post comment
About us
Subscription
Unsubscription

AltStyle によって変換されたページ (->オリジナル) /