On Fri, 2007-11-30 at 14:46 -0500, Robert Cummings wrote:
>
> This is dangerous use of the array functions. A problem occurs when you
> have a value that evaluates to false (such as the first entry in the
> example array :). In fact the only way to ensure you traverse the array
> properly is to use
On Fri, 2007-11-30 at 09:51 -0800, Jim Lucas wrote:
> Jeffery Fernandez wrote:
> > Hi all,
> >
> > Is it possible to rewind a foreach loop? eg:
> >
> >
> > $numbers = array(0,1,2,3,4,5,6,7,8,9,10);
> >
> > foreach ($numbers as $index => $value)
> > {
> > if ($value == 5)
> > {
>
Jeffery Fernandez wrote:
Hi all,
Is it possible to rewind a foreach loop? eg:
$numbers = array(0,1,2,3,4,5,6,7,8,9,10);
foreach ($numbers as $index => $value)
{
if ($value == 5)
{
prev($numbers);
}
echo "Value: $value" . PHP_EOL;
}
The above do
Jeffery Fernandez wrote:
> Hi all,
>
> Is it possible to rewind a foreach loop? eg:
>
>
> $numbers = array(0,1,2,3,4,5,6,7,8,9,10);
>
> foreach ($numbers as $index => $value)
> {
> if ($value == 5)
> {
> prev($numbers);
> }
> echo "Value: $value"
I think the best option for me is to refactorise my code a bit to cater to my
situation. Thanks all for your help.
Jeffery
On Fri, 30 Nov 2007 02:32:11 pm Jeffery Fernandez wrote:
> On Fri, 30 Nov 2007 02:13:52 pm Chris wrote:
> > Jeffery Fernandez wrote:
> > > On Fri, 30 Nov 2007 02:01:47 pm Ch
At 2:11 PM +1100 11/30/07, Jeffery Fernandez wrote:
On Fri, 30 Nov 2007 02:01:47 pm Chris <[EMAIL PROTECTED]> wrote:
Jeffery Fernandez wrote:
> Hi all,
>
> Is it possible to rewind a foreach loop? eg:
>
>
> $numbers = array(0,1,2,3,4,5,6,7,8,9,10);
>
> foreach ($numbers as $index => $va
On Fri, 30 Nov 2007 02:13:52 pm Chris wrote:
> Jeffery Fernandez wrote:
> > On Fri, 30 Nov 2007 02:01:47 pm Chris wrote:
> >> Jeffery Fernandez wrote:
> >>> Hi all,
> >>>
> >>> Is it possible to rewind a foreach loop? eg:
> >>>
> >>>
> >>> $numbers = array(0,1,2,3,4,5,6,7,8,9,10);
> >>>
> >>> forea
$keys = array_values($array);
for ($i=0; $i wrote:
Jeffery Fernandez wrote:
On Fri, 30 Nov 2007 02:01:47 pm Chris wrote:
Jeffery Fernandez wrote:
Hi all,
Is it possible to rewind a foreach loop? eg:
$numbers = array(0,1,2,3,4,5,6,7,8,9,10);
foreach ($numbers as $index => $value)
{
Jeffery Fernandez wrote:
On Fri, 30 Nov 2007 02:01:47 pm Chris wrote:
Jeffery Fernandez wrote:
Hi all,
Is it possible to rewind a foreach loop? eg:
$numbers = array(0,1,2,3,4,5,6,7,8,9,10);
foreach ($numbers as $index => $value)
{
if ($value == 5)
{
prev($num
On Fri, 30 Nov 2007 02:01:47 pm Chris wrote:
> Jeffery Fernandez wrote:
> > Hi all,
> >
> > Is it possible to rewind a foreach loop? eg:
> >
> >
> > $numbers = array(0,1,2,3,4,5,6,7,8,9,10);
> >
> > foreach ($numbers as $index => $value)
> > {
> > if ($value == 5)
> > {
> >
Jeffery Fernandez wrote:
Hi all,
Is it possible to rewind a foreach loop? eg:
$numbers = array(0,1,2,3,4,5,6,7,8,9,10);
foreach ($numbers as $index => $value)
{
if ($value == 5)
{
prev($numbers);
}
echo "Value: $value" . PHP_EOL;
}
The above do
11 matches
Mail list logo