?>
boolean in_array(value query, array data)
The in_array function returns TRUE if the query argument is an element of the data
argument.
Table 9.1. extract Modes
Mode Description
EXTR_OVERWRITE (^) Overwrite any variables with the same name.
EXTR_SKIP (^) Skip any variables with the same name.
EXTR_PREFIX_SAME (^) Add prefix to variables with same name.
EXTR_PREFIX_ALL (^) Prefix all variables.
<?
//create test data
$colors = array("red", "green", "blue");
//test for the presence of green
if(in_array("green", $colors))
{
print("Yes, green is present!");
}
?>
string implode(array data, string delimiter)
The implode function transforms an array into a string. The elements are concatenated
with the delimiter string separating them. To perform the reverse functionality, use
explode.
<?
/*
* convert an array into a comma-delimited string
/
$colors = array("red", "green", "blue");
$colors = implode($colors, ",");
print($colors);
?>
join
You may use join as an alias to the implode function.