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

Home » Imported messages » comp.lang.php » comma placement problem
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: comma placement problem [message #181533 is a reply to message #181530] Mon, 20 May 2013 20:00 Go to previous messageGo to previous message
Luuk is currently offline  Luuk
Messages: 329
Registered: September 2010
Karma:
Senior Member
On 20-05-2013 20:32, richard wrote:
> This does exactly what I want except that when 1969 is reached, the commas
> don't get placed where I want them.
> I need the commas on every line except for the last line.
> which is why I put the conditional just before the \n.
>

> $number=1;
> $number=(int)$number;

?? why this second assignment?

> while ($year<=1969):

i think an assignment to $number should be placed here....

> while ($number<=10):

....
> if ($year<1969 and $number<=10){echo ",";}

and a check to print "," based on "$number<=10" why?
this 'if' is placed in a 'while' loop with condition "$number<=10",
there should be no need to check if $number is <= 10....

> echo "\n";
> $number++;
> endwhile;
>
> $number=1;
aaah here is is, a better place would be just before the 'while'

> $year++;
>
> endwhile;
>
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Immediate Position:::Business Analyst With BI EXP::::At Houston, TX
Next Topic: Problem with quotes in javascript output
Goto Forum:
  

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

Current Time: Sun Nov 24 11:31:04 GMT 2024

Total time taken to generate the page: 0.04502 seconds