FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Comments legal? For loop legal?
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Comments legal? For loop legal? [message #170523 is a reply to message #170521] Fri, 05 November 2010 22:02 Go to previous messageGo to previous message
Denis McMahon is currently offline  Denis McMahon
Messages: 634
Registered: September 2010
Karma:
Senior Member
On 05/11/10 21:44, Brian Smither wrote:
> I'm getting T_ELSE errors and I wonder if there are issues with the
> following lines of code...
>
> // Digital Product : BEGIN
>
> Would a colon ever constitute a beginning or ending of a script block?
>
> for($j=0;$j<count($results);$j++) {
>
> Would lack of white space after the semi-colons ever cause a problem?

If this is the line that the error is thrown out on, it's quite possible
that the error is in the preceding line(s) of code.

Also, I hope that if count($results) changes while the for loop is
executing, it does so in the manner that you expect it to?

I'd normally use:

$limit = count($results);
for($j=0;$j<$limit;$j++) {

However I don't think this will solve your problem, as I think your
problem is caused by something other than the start of this for loop.

Rgds

Denis McMahon
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: There is some framework/tool to generate PHP code
Next Topic: urls in php
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Nov 22 23:29:09 GMT 2024

Total time taken to generate the page: 0.04497 seconds