1.2.1486. ext/array¶
Core functions processing arrays.
These functions manipulate arrays in various ways. Arrays are essential for storing, managing, and operating on sets of variables.
This is not a real extension : it is a documentation section, that helps classifying the functions.
<?php
function odd($var)
{
// returns whether the input integer is odd
return($var & 1);
}
function even($var)
{
// returns whether the input integer is even
return(!($var & 1));
}
$array1 = array('a'=>1, 'b'=>2, 'c'=>3, 'd'=>4, 'e'=>5);
$array2 = array(6, 7, 8, 9, 10, 11, 12);
echo 'Odd :'.PHP_EOL;
print_r(array_filter($array1, 'odd'));
echo 'Even:'.PHP_EOL;
print_r(array_filter($array2, 'even'));
?>
See also Arrays.
1.2.1486.1. Specs¶
Short name |
Extensions/Extarray |
Rulesets |
|
Exakat since |
0.8.4 |
PHP Version |
All |
Severity |
|
Time To Fix |
|
Precision |
Very high |
Available in |