Re: Form again
| From: | Philip Olson | Date: | Wed, 27 Dec 2000 20:33:48 +0000 |
| Subject: | Re: Form again | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-32001@lists.php.net to get a copy of this message | ||
Hi Chris,
Depends on your preference :-) Regarding your line, I find doing it
as below the "easiest" to read, especially how my syntax highlighting is
displayed and how _my_ brain/eyes see it :
print '<input type="radio" name="'. $C4 .'"
value="'. $D4 .'">'. $C4;
Not sure how html compliant single quotes are and just assume double
quotes are more accepted (name='f' vs name="f"). HTML4.0 seems to enjoy
the single quotes so that's mostly paranoia me thinks.
A great tutorial on strings is :
http://www.zend.com/zend/tut/using-strings.php
And note, when a string is in double quotes, PHP will analyze it and
parse, this is not the case with single quotes so logic suggests single
quotes are "faster" as they are skipped over, although the performance
gain is "small." Totally breaking out of PHP is of course an option too.
It is personal choice and no "best" way exists for all situations. It
seems "wiser" to print html as html, php as php but depends on the
situation. Don't fear breaking out of PHP! Read that tutorial, it
explains all this better then I. :-) Through experience this will become
less of an issue.
Also, *. concatenate .* is fun to say!
Regards,
Philip
> On Wed, 27 Dec 2000, Chris Lee wrote:
>
> > This is a question relating to the origonal code, Ive allways wondered
> > why do people start php, stop php, start php, stop php all on one line? I
> > prefer this, its easier to read.
> >
> > <?php
> > echo "<input type='radio' value='$D4'
> > name='C4'>$D4 \n";
> > ?>
> >
> > Im sure the answer is personal opinion, but it is easier to read isnt it?
> > and therefore easier to add/delete/modify code right?
> >
> > Chris Lee
> > Mediawaveonline.com
> >