For Programmers: Free Programming Magazines  


Home > Archive > PHP Language > March 2006 > Re: array->string









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: array->string
neil davis

2006-03-28, 6:57 pm

On Sun, 26 Jun 2005 19:28:53 +0300, Kimmo Laine wrote:

> "Ron Eggler @ work" <nospam@hotmail.com> kirjoitti
> viestissä:3i1ka5FisvioU1@individual.net...
>
>
> for($j=0;j<=count($spamArray); j++)
> {
> $outStr.="<option>".$spamArray[$j]."</option>";
> }


Today's question du jour is: What is the next error this programmer
will see, now that the code parses?

Tune in tomorrow for the solution.
Hint: "progressing by leaps and [this]"

(and don't cheat by trying to run the
code ya bunch of slackers... debug it in your mind)
Geoff Berrow

2006-03-28, 6:57 pm

Message-ID:
<pan.2006.03.28.21.31.26.503937@dont.spam.me.or.ill.kill.your.dog> from
neil davis contained the following:

>
>Today's question du jour is: What is the next error this programmer
>will see, now that the code parses?


Undefined constant j ?

--
Geoff Berrow 0110001001101100010000000110
0011011010110110010001101111011001110010
11
1001100011011011110010111001110101011010
11
David Haynes

2006-03-28, 6:57 pm

Geoff Berrow wrote:
> Message-ID:
> <pan.2006.03.28.21.31.26.503937@dont.spam.me.or.ill.kill.your.dog> from
> neil davis contained the following:
>
>
> Undefined constant j ?
>

and/or the ever popular non-sequential or non-zero-based array problem.

(see guys, I do pay attention ;-) )

-david-

neil davis

2006-03-29, 6:57 pm

On Tue, 28 Mar 2006 21:24:19 +0000, neil davis wrote:

> On Sun, 26 Jun 2005 19:28:53 +0300, Kimmo Laine wrote:
>
>
> Today's question du jour is: What is the next error this programmer
> will see, now that the code parses?
>
> Tune in tomorrow for the solution.
> Hint: "progressing by leaps and [this]"
>
> (and don't cheat by trying to run the
> code ya bunch of slackers... debug it in your mind)


What is an array out of bounds?
This was my answer, but I am wrong and I admit it.
The gentleman that mentioned the undefined constant wins the prize.
Mine would have been next...

for (no pun intended) this to work:
for($j=0;$j<count($spamArray); $j++)
{
$outStr.="<option>".$spamArray[$j]."</option>";
}


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com