Voting

: max(two, zero)?
(Example: nine)

The Note You're Voting On

keithbluhm at gmail dot com
15 years ago
Run a match on the array's keys rather than the values:

<?php

function preg_grep_keys( $pattern, $input, $flags = 0 )
{
$keys = preg_grep( $pattern, array_keys( $input ), $flags );
$vals = array();
foreach (
$keys as $key )
{
$vals[$key] = $input[$key];
}
return
$vals;
}

?>

<< Back to user notes page

To Top