On Fri, Oct 28, 2011 at 14:18, Jim Long <p...@umpquanet.com> wrote:
>
> If you are certain that your array is consecutively indexed from
> 0, you can shave two lines off your code with:
>
>        $allFiles = array("coffee.jpg", "tea.jpg", "milk.jpg");
>        foreach ($allFiles as $key => $currFile) {
>                doThisWith($currFile);
>                doThatWith($key+1);
>        }

    See also: http://php.net/array_walk

-- 
</Daniel P. Brown>
Network Infrastructure Manager
http://www.php.net/

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

Reply via email to