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 #181534 is a reply to message #181533] Mon, 20 May 2013 20:40 Go to previous messageGo to previous message
richard is currently offline  richard   
Messages: 213
Registered: June 2013
Karma:
Senior Member
On Mon, 20 May 2013 22:00:08 +0200, Luuk wrote:

> 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....
>

I tried that. What I got was no comma when $year=1969.
Apparently, the last comma doesn't seem to make any difference.
the script works just fine with it.
[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 10 12:24:32 GMT 2024

Total time taken to generate the page: 0.04178 seconds