Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #9481
| Path | csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail |
|---|---|
| Date | Mon, 20 May 2013 22:00:08 +0200 |
| From | Luuk <luuk@invalid.lan> |
| User-Agent | Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130509 Thunderbird/17.0.6 |
| MIME-Version | 1.0 |
| Newsgroups | comp.lang.php |
| Subject | Re: comma placement problem |
| References | <bgnwqrwpql3u$.1hv0a1p6pymz3.dlg@40tude.net> |
| In-Reply-To | <bgnwqrwpql3u$.1hv0a1p6pymz3.dlg@40tude.net> |
| Content-Type | text/plain; charset=ISO-8859-1; format=flowed |
| Content-Transfer-Encoding | 7bit |
| Message-ID | <8vbq6a-lv5.ln1@luuk.invalid.lan> (permalink) |
| Lines | 37 |
| NNTP-Posting-Host | 2001:980:9089:1:a9dd:eedd:feb5:d015 |
| X-Trace | 1369080601 news.xs4all.nl 15919 [2001:980:9089:1:a9dd:eedd:feb5:d015]:47089 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.php:9481 |
Show key headers only | View raw
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;
>
Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
comma placement problem richard <noreply@example.com> - 2013-05-20 14:32 -0400
Re: comma placement problem "Peter H. Coffin" <hellsop@ninehells.com> - 2013-05-20 14:48 -0500
Re: comma placement problem Salvatore <sal@yojimbo.hack.invalid> - 2013-05-20 19:57 +0000
Re: comma placement problem Luuk <luuk@invalid.lan> - 2013-05-20 22:00 +0200
Re: comma placement problem richard <noreply@example.com> - 2013-05-20 16:40 -0400
Re: comma placement problem Christoph Becker <cmbecker69@gmx.de> - 2013-05-20 23:05 +0200
Re: comma placement problem Paul Herber <paul@pherber.com> - 2013-05-21 09:51 +0100
csiph-web