PHP: array_keys - Manual in Deutsh
PHP: array_keys - Manual in French
PHP: array_keys - Manual in Polish

You Are At PHP: array_keys - Manual Area


recent searches:
include functions , variable functions , post functions...




If you are new to PHP or just need to refresh your skills, this is the place to start. This series of tutorials will give you the basic knowledge you will need to create a simple PHP website.

PHP is a reflective programming language originally designed for producing dynamic web pages.[1] PHP is used mainly in server-side scripting, but can be used from a command line interface or in standalone graphical applications. Textual User Interfaces can also be created using ncurses.

PHP Manual
PrevNext

array_keys

(PHP 4, PHP 5)

array_keys -- Return all the keys of an array

Description

array array_keys ( array input [, mixed search_value [, bool strict]] )

array_keys() returns the keys, numeric and string, from the input array.

If the optional search_value is specified, then only the keys for that value are returned. Otherwise, all the keys from the input are returned. As of PHP 5, you can use strict parameter for comparison including type (===).

Example 1. array_keys() example

<?php
$array
= array(0 => 100, "color" => "red");
print_r(array_keys($array));

$array = array("blue", "red", "green", "blue", "blue");
print_r(array_keys($array, "blue"));

$array = array("color" => array("blue", "red", "green"),
               
"size"  => array("small", "medium", "large"));
print_r(array_keys($array));
?>

The above example will output:

Array
(
    [0] => 0
    [1] => color
)
Array
(
    [0] => 0
    [1] => 3
    [2] => 4
)
Array
(
    [0] => color
    [1] => size
)

See also array_values() and array_key_exists().

szkolenia dla księgowych kursy księgowe księgowość
Solidnie i tanio przeprowadzki kraków transport mebli, profesjonalnie
kalkulator kredytu hipotecznego
Prawo jazdy Szczecin
Oryginalne perfumy w promocyjnych cenach

Another Useful functions:


zend-macro.zend-arg-array-info | zend-api.zend-get-parameters-array | zend-api.zend-get-parameters-array-ex | zend-api.zend-copy-parameters-array | zend-api.init-op-array | zend-api.destroy-op-array | zend-api.array-init | ref.array | language.types.array | language.operators.array | function.udm-alloc-agent-array | function.sybase-fetch-array | function.sqlite-fetch-array | function.sqlite-array-query | function.sesam-field-array | function.sesam-fetch-array | function.pg-fetch-array | function.odbc-fetch-array | function.oci-fetch-array | function.oci-bind-array-by-name | function.mysqli-fetch-array | function.mysql-fetch-array | function.mssql-fetch-array | function.msql-fetch-array | function.msession-set-array | function.msession-get-array | function.maxdb-fetch-array | function.iterator-to-array | function.is-array | function.ingres-fetch-array | function.in-array | function.hw-objrec2array | function.hw-array2objrec | function.httpquerystring-toarray | function.filter-var-array | function.filter-input-array | function.fbsql-fetch-array | function.db2-fetch-array | function.curl-setopt-array | function.call-user-method-array | function.call-user-func-array | function.arrayobject-offsetunset | function.arrayobject-offsetset | function.arrayobject-offsetget | function.arrayobject-offsetexists | function.arrayobject-getiterator | function.arrayobject-count | function.arrayobject-construct | function.arrayobject-append | function.arrayiterator-valid | function.arrayiterator-seek | function.arrayiterator-rewind | function.arrayiterator-next | function.arrayiterator-key | function.arrayiterator-current | function.array | function.array-walk | function.array-walk-recursive | function.array-values | function.array-unshift | function.array-unique | function.array-uintersect | function.array-uintersect-uassoc | function.array-uintersect-assoc | function.array-udiff | function.array-udiff-uassoc | function.array-udiff-assoc | function.array-sum | function.array-splice | function.array-slice | function.array-shift | function.array-search | function.array-reverse | function.array-reduce | function.array-rand | function.array-push | function.array-product | function.array-pop | function.array-pad | function.array-multisort | function.array-merge | function.array-merge-recursive | function.array-map | function.array-keys | function.array-key-exists | function.array-intersect | function.array-intersect-ukey | function.array-intersect-uassoc | function.array-intersect-key | function.array-intersect-assoc | function.array-flip | function.array-filter | function.array-fill | function.array-fill-keys | function.array-diff | function.array-diff-ukey | function.array-diff-uassoc | function.array-diff-key | function.array-diff-assoc | function.array-count-values | function.array-combine | function.array-chunk | function.array-change-key-case |


PHP is a widely-used general-purpose scripting language that is especially suited for Web development and can be embedded into HTML. If you are new to PHP and want to get some idea of how it works, try the introductory tutorial. After that, check out the online manual, and the example archive sites and some of the other resources available in the links section.