Re: how to find

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Peppe wrote:

I have numbers in my array
0 0 0 1 1 1 1 1 1 1 1 0 0 0 0
or
 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0
or
 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0
how can I find the first 1 and the last is there a function for it
Regards

array_search() returns first '1'

array_keys() can return all '1's

getting the highest or last from the return of array_keys() gives you the last with '1'

--
Sebastian Mendel

www.sebastianmendel.de www.warzonez.de www.tekkno4u.de www.nofetish.com
www.sf.net/projects/phpdatetime        www.sf.net/projects/phptimesheet

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux