|
|
|
#11 (permalink) | ||||||||||||||
|
PC Gamer
|
Quote:
But if you're doing huge comparisons like that, use the switch case structure that Dismounted posted. Saves time, it's easier to read, and more flexible.
__________________
I have four words for you... DEVELOPERS DEVELOPERS DEVELOPERS DEVELOPERS Five thousand, two hundred, and eighty points per day Next upgrades: 150 GB Raptor; 24" Monitor; 9800 GTX 4 SLI; Q6600; Auzentech Prelude; * Waiting on Sandy Bridge *
|
||||||||||||||
|
|
|
|
#12 (permalink) | |||||||||||||
|
Programmer
|
This is something you shouldn't do, and I consider this bad coding practice. What is someone has short_tags disabled? Your script won't run then. Always use <?php, for compatibility reasons. It is not that much harder to type "php", is it?
__________________Someone may have noticed that in my previous post, I used single quotes instead of double. This is because using double quotes will instruct PHP to parse the string for any variables, and because of this, it is slightly slower. You may also notice that I used echo() in place of print(). This is because echo() is slightly faster because print() needs to return a boolean (true/false) value. Although these speed "increases" are so small they are not noticeable normally, it is a good habit to write code that runs as fast as possible. It may be just me, as I work on fairly large PHP projects - every little bit counts.
|
|||||||||||||
|
|
|
|
#13 (permalink) | |||||||||||||||
|
Programmer
|
Quote:
; NOTE: Using short tags should be avoided when developing applications or ; libraries that are meant for redistribution, or deployment on PHP ; servers which are not under your control, because short tags may not ; be supported on the target server. For portable, redistributable code, ; be sure not to use short tags. True Unfortunately, this is one of the easiest ways to make a template. I just hate this <?echo($a)?> .. It's times better <?=$a?>... Well, from now on, I'll use my template engine in making the templates.
__________________
- Marin Ivanov - Debian worshipper Link of the month: Phlame - PHP Web Server with PHP support (Linux Alpha 0.1.41 released) My: Clubs, Photo, Web projects, CheapTechs, Quote:
|
|||||||||||||||
|
|
|
|
|
#14 (permalink) | ||||||||||||
|
Overclocker in Training
|
actually, it is all a matter of personal preference.
and i personally prefer to do things the (well we can't call them "standard" so) "long-hand" way. <?php echo $var ?> only as a practice (Even in my own very small usage cases to keep the habit) because most (or most that i've worked with) open source projects keep this standard. whatever tickles your phpickle
__________________
screenshot of BFG-c2d on gentoo linux http://remixtechnology.com/view/bfg-...deo-screenshot
|
||||||||||||
|
|
|
|
|
#15 (permalink) | ||||||||||||||
|
Security Sleuth
|
Ahaha, remix. That was quite the humorous PHP pun. Took me a second to see that.
On a side note, darn I wish I knew what you guys do. =(
__________________
Quote:
Proud Member of the Linux Gaming CommunityI am your friend.
|
||||||||||||||
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
|
|