Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #11093
| Date | 2011-01-31 14:38 +0100 |
|---|---|
| From | Luuk <Luuk@invalid.lan> |
| Newsgroups | comp.lang.php |
| Subject | Re: Heredoc print to file? Use nowdoc. |
| References | <Dgp1p.26682$Tg1.1971@newsfe13.iad> <ii5eo4$ov7$1@news.eternal-september.org> <LCt1p.68620$7p5.63929@newsfe21.iad> <ii6a9c$kmg$1@news.eternal-september.org> <Csy1p.9030$Y8.1426@newsfe06.iad> |
| Message-ID | <tjqi18-6gk.ln1@luuk.invalid.lan> (permalink) |
On 31-01-11 14:05, P E Schoen wrote:
> It would be better with an associative array but I'm not sure if I can
> loop through with:
>
> // eid,etype,et,eurl,sdt,sdow,edt,edow,ed (array elements)
> for ($i = 'eid'; $i <= 'ed'; $i++) {
> $arr[$line][$i] = $row[$i];
> }
>
> I would normally (in Delphi) do this with an "enum" with the integers
> 0..8 represented by eid..ed.
http://nl2.php.net/manual/en/control-structures.foreach.php
$a = array('eid','etype','et','eurl','sdt','sdow','edt','edow','ed');
foreach ($a as $value) {
echo $value."\n";
}
--
Luuk
Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: Heredoc print to file? Use nowdoc. Jerry Stuckle <jstucklex@attglobal.net> - 2011-01-30 23:44 -0500
Re: Heredoc print to file? Use nowdoc. Tim Streater <timstreater@waitrose.com> - 2011-01-31 15:49 +0000
Re: Heredoc print to file? Use nowdoc. Luuk <Luuk@invalid.lan> - 2011-01-31 14:38 +0100
Re: Heredoc print to file? Use nowdoc. Jerry Stuckle <jstucklex@attglobal.net> - 2011-01-31 07:34 -0500
Re: Heredoc print to file? Use nowdoc. "P E Schoen" <paul@pstech-inc.com> - 2011-01-31 08:05 -0500
Re: Heredoc print to file? Use nowdoc. Tim Streater <timstreater@waitrose.com> - 2011-01-31 16:11 +0000
Re: Heredoc print to file? Use nowdoc. "P E Schoen" <paul@pstech-inc.com> - 2011-01-31 02:31 -0500
Re: Heredoc print to file? Use nowdoc. Norman Peelman <npeelman@cfl.rr.com> - 2011-01-31 06:32 -0500
csiph-web