User Tools

Site Tools


uphp:functions:array_keys

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
uphp:functions:array_keys [2017/02/28 13:34]
jeff
uphp:functions:array_keys [2021/09/13 05:57] (current)
Line 1: Line 1:
 ======array_keys====== ======array_keys======
 +
 <badge>WMPRO, WMMINI FW >= 1.0</badge> <badge>WMMEGA FW >= 2.0</badge> <badge>WMPRO, WMMINI FW >= 1.0</badge> <badge>WMMEGA FW >= 2.0</badge>
  
-Return keys for an array that has key/value pairs+Return keys for an <html><b><span style="color:green">array<span style="color:black"></b></html> that has key/value pairs
  
 ====Description==== ====Description====
-<well size="sm"><html><span style="font-size:125%;color:green;">array + 
-<span style="color:black;"></html>[[array_keys]] +<well size="sm"><html> 
-<html>+<span style="font-size:125%;color:green">array 
-<span style="color:green;">array +<span style="color:black">array_keys ( 
-<span style="color:blue;">$array +<span style="color:green">array 
-<span style="color:black;">)+<span style="color:blue">$array 
 +<span style="color:black">)
 </html></well> </html></well>
-Return an array object 
  
-====Parameters==== +Return an <html><b><span style="color:green">array<span style="color:black"></b></html> object
-An <html><span style="color:blue;"><b>array</b><span style="color:black;"></html> with key/value pairs+
  
-====Return Value==== +====Parameter==== 
-An array of keys+ 
 +<html><b><span style="color:blue">$array<span style="color:black"></b>: An <b><span style="color:green">array<span style="color:black"></b> with key/value pairs</html> 
 + 
 +====Return Values==== 
 + 
 +An <html><b><span style="color:green">array<span style="color:black"></b></html> of keys
  
 ====Example==== ====Example====
-<code php><?  
-$arr=array(); 
-$arr['name']="John"; 
-$arr['age']=30; 
-$arr['status']=1; 
-$keys=array_keys($arr); 
-print_r($keys); 
  
-/* output will be+<code php> 
-p0 ARRAY +<pre><? 
-STRING 0 => name +  $arr=array(); 
-STRING 1 => age +  $arr['name']="John"; 
-STRING 2 => status +  $arr['age']=30; 
-*/ +  $arr['status']=1; 
-?></code>+  $keys=array_keys($arr); 
 +  print_r($keys); 
 +?></pre> 
 +</code> 
 + 
 +The above example will output
 +<code> 
 +[$keys] Array ( 
 +(string) [0=> name 
 +(string) [1=> age 
 +(string) [2=> status 
 +) 
 +</code>
  
 ====See Also==== ====See Also====
-[[array()]] - Create an array with values 
  
-[[array_key()]] - Return the key for an array index+[[array()]] - Create an <html><b><span style="color:green">array<span style="color:black"></b></html>, with optional values 
 + 
 +[[array_key()]] - Return the key for an <html><b><span style="color:green">array<span style="color:black"></b></html> index
  
-[[sizeof()]] - Return the number of elements in an array+[[sizeof()]] - Return the number of elements in an <html><b><span style="color:green">array<span style="color:black"></b></html>
  
-[[print_r()]] - Dump the contents of an array to the current output+[[print_r()]] - Dump the contents of an <html><b><span style="color:green">array<span style="color:black"></b></html> to the current output
  
 [[uphp:variables|uPHP Variable Types and Limits]] [[uphp:variables|uPHP Variable Types and Limits]]
  
uphp/functions/array_keys.1488288891.txt.gz · Last modified: 2021/09/13 05:56 (external edit)