Re: Trying to understand what is happening in this code
| From: | Stuart Dallas | Date: | Fri, 11 Oct 2013 15:39:25 +0000 |
| Subject: | Re: Trying to understand what is happening in this code | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-322278@lists.php.net to get a copy of this message | ||
On 11 Oct 2013, at 16:20, Nathan Grey <greynng@gmail.com> wrote:
> Stuart, Jose - Thanks for your quick response. Are you saying that the processor echos all the
> html tags it sees. Is it doing something like this to the script:
>
> echo <body>
> echo <h1>The first twenty Fibonacci numbers:</h1>
> echo <ul>
> <?php
> $first = 0;
> $second = 1;
> for ($i = 0; $i < 20; $i++) {
> ?>
> echo <li><?php echo $first + $second ?></li>
> <?php
> $temp = $first + $second;
> $first = $second;
> $second = $temp;
>
> } ?>
> echo </ul>
> echo </body>
>
> Or is it just the line in question that is being echoed?
I'm not sure exactly what it gets compiled to, but I also don't see why it matters. All
that matters is that content outside of PHP tags will simply get echo'd.
-Stuart
--
Stuart Dallas
3ft9 Ltd
http://3ft9.com/