[Php-it] array ricerca ordine alfabetico
Luca 'Ziabice' Gambetta
lucagambetta at tiscali.it
Tue Apr 3 11:32:01 CEST 2007
On Mon, 2 Apr 2007 10:54:37 +0200
"Cristiano Verondini" <cverondini at deis.unibo.it> wrote:
> function MyFind($where, $what) {
>
> $res = array();
> for ($i = 0, $m = count($where); $i < $m; $i++)
> if (substr($v = $where[ $i ], 0, 1) === $what)
> $res[] = $v;
>
> return $res;
> }
>
> Cris
>
Provaci ancora, Cris!
function puccialo(&$arr, $lettera) {
$s = create_function('$e', 'return $e{0} == \''.$lettera.'\';');
return array_filter($arr, $s);
}
--
"Uhm... l'ho detto o l'ho solo pensato?"
.::. Ziabice aka Luca Gambetta .::.
More information about the Php-it
mailing list