Unix and Linux Discussions Tagged with apple |
|
Thread / Thread Starter |
Last Post |
Replies |
Views |
Forum |
|
|
|
6 |
38,465 |
OS X (Apple) |
|
|
|
10 |
22,667 |
OS X (Apple) |
|
|
|
30 |
51,403 |
OS X (Apple) |
|
|
|
0 |
3,952 |
OS X (Apple) |
|
|
|
0 |
5,736 |
Hardware |
|
|
|
6 |
7,384 |
OS X (Apple) |
|
|
|
3 |
2,846 |
What is on Your Mind? |
|
|
|
0 |
5,906 |
What is on Your Mind? |
|
|
|
2 |
5,107 |
Red Hat |
|
|
|
11 |
8,212 |
Solaris |
|
|
|
35 |
13,694 |
What is on Your Mind? |
|
|
|
68 |
22,649 |
What is on Your Mind? |
|
|
|
17 |
11,973 |
What is on Your Mind? |
|
|
|
0 |
1,285 |
Security Advisories (RSS) |
|
|
|
0 |
1,526 |
Software Releases - RSS News |
|
|
|
0 |
1,487 |
Software Releases - RSS News |
|
|
|
0 |
3,727 |
Oracle Updates (RSS) |
|
|
|
0 |
1,252 |
Security Advisories (RSS) |
|
|
|
3 |
4,780 |
OS X (Apple) |
|
|
|
0 |
3,255 |
OS X Support RSS |
|
|
|
0 |
4,975 |
OS X Support RSS |
|
|
|
0 |
2,672 |
OS X Support RSS |
|
|
|
0 |
2,134 |
OS X Support RSS |
|
|
|
0 |
1,924 |
OS X Support RSS |
|
|
|
0 |
2,581 |
OS X Support RSS |
|
|
|
0 |
1,665 |
OS X Support RSS |
|
|
|
0 |
4,595 |
OS X Support RSS |
|
|
|
0 |
3,022 |
OS X Support RSS |
|
|
|
0 |
1,753 |
OS X Support RSS |
|
|
|
0 |
5,906 |
OS X Support RSS |
|
|
|
0 |
3,276 |
OS X Support RSS |
|
|
|
0 |
1,393 |
OS X Support RSS |
|
|
|
0 |
1,489 |
OS X Support RSS |
|
|
|
0 |
2,009 |
OS X Support RSS |
|
|
|
0 |
1,375 |
OS X Support RSS |
|
|
|
0 |
1,702 |
OS X Support RSS |
|
|
|
0 |
2,481 |
OS X Support RSS |
|
|
|
0 |
2,198 |
UNIX and Linux RSS News |
|
|
|
0 |
1,796 |
UNIX and Linux RSS News |
|
|
|
0 |
966 |
Software Releases - RSS News |
KEY(3) 1 KEY(3)
key - Fetch a key from an array
SYNOPSIS
mixed key (array &$array)
DESCRIPTION
key(3) returns the index element of the current array position.
PARAMETERS
o $array
- The array.
RETURN VALUES
The key(3) function simply returns the key of the array element that's currently being pointed to by the internal pointer. It does not
move the pointer in any way. If the internal pointer points beyond the end of the elements list or the array is empty, key(3) returns NULL.
EXAMPLES
Example #1
key(3) example
<?php
$array = array(
'fruit1' => 'apple',
'fruit2' => 'orange',
'fruit3' => 'grape',
'fruit4' => 'apple',
'fruit5' => 'apple');
// this cycle echoes all associative array
// key where value equals "apple"
while ($fruit_name = current($array)) {
if ($fruit_name == 'apple') {
echo key($array).'<br />';
}
next($array);
}
?>
The above example will output:
fruit1<br />
fruit4<br />
fruit5<br />
SEE ALSO
current(3), next(3).
PHP Documentation Group KEY(3)