Re: array limits in echo function?
| From: | lmlweb | Date: | Tue, 09 Apr 2002 04:43:56 +0000 |
| Subject: | Re: array limits in echo function? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-92170@lists.php.net to get a copy of this message | ||
Hi Miguel,
I'm reading the manual as of this moment. Thank you for saying "RTFM" so
very nicely!
I guess I've used "$fname $lname" before, and just forgot at this point.
Cheers,
Laurie
"Miguel Cruz" <mnc@stoic.net> wrote in message
news:Pine.LNX.4.44.0204082330030.3884-100000@stoic.net...
> On Mon, 8 Apr 2002, lmlweb wrote:
> > I'm just curious:
> >
> > if I use within my html codes:
> >
> > <?php echo $fname $lname; ?>, I get an error message telling me:
> >
> > Parse error: parse error, expecting
','' or
> > ';''
> >
> > However, if I take out one of the variables so that it reads <?php echo
> > $lname; ?> it works.
> >
> > Has it always been this way? I never noticed before, as I'm quite the
> > newbie. If so, how do I best combine the two (other than having to
create
> > two separate <?php..?> codes in the HTML)?
>
> Syntax is not random.
>
> echo wants to be fed a comma-separated list of arguments. This is very
> clearly described in the manual (http://php.net/echo) and should not be
> difficult to figure out.
>
> So you can sent it a variable:
>
> echo $fname;
>
> Or you can send it a string:
>
> echo "Hello";
>
> Or you can send it a string that contains some variables:
>
> echo "$fname $lname";
>
> Or you can send it a bunch of variables and strings:
>
> echo $fname, ' ', $lname;
>
> The manual is your friend.
>
> miguel
>