Voting

: max(five, seven)?
(Example: nine)

The Note You're Voting On

craig1231 at hotmail dot com
13 years ago
A needed a function to find the keys which contain part of a string, not equalling a string...

<?php
function array_keys_contain($input, $search_value, $strict = false)
{
$tmpkeys = array();

$keys = array_keys($input);

foreach (
$keys as $k)
{
if (
$strict && strpos($k, $search_value) !== FALSE)
$tmpkeys[] = $k;
elseif (!
$strict && stripos($k, $search_value) !== FALSE)
$tmpkeys[] = $k;
}

return
$tmpkeys;
}
?>

<< Back to user notes page

To Top