TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 11-07-2009, 12:23 AM   #1 (permalink)
The Contributor
 
Join Date: Apr 2008
Location: Nevada, USA
Posts: 52
Thanks: 10
h0ly lag is on a distinguished road
Default Common short tags

What are the common PHP short tags? I know of a few such as <?=$str ?>. Actually thats about all I know.
__________________
Send a message via AIM to h0ly lag Send a message via MSN to h0ly lag
h0ly lag is offline  
Reply With Quote
Old 11-07-2009, 03:08 AM   #2 (permalink)
how quixotic are you?
 
ETbyrne's Avatar
 
Join Date: Dec 2007
Location: Lapeer, MI
Posts: 445
Thanks: 37
ETbyrne is on a distinguished road
Default

Well you got the loop ones:

PHP Code:
<?php foreach($data as $row): ?>

Something...

<?php endforeach; ?>
__________________
Dingo Web Systems > http://www.dingocode.com
My Website > http://www.evanbot.com
ETbyrne is offline  
Reply With Quote
Old 11-09-2009, 10:53 PM   #3 (permalink)
is cute and cuddly
 
delayedinsanity's Avatar
 
Join Date: Mar 2008
Location: Vegas, Baby
Posts: 963
Thanks: 31
delayedinsanity is on a distinguished road
Default

What ETbyrne is referring to is actually called 'alternative conditional structures' and can be highly useful when writing mixed PHP and HTML pages.

As for short tags, the best answer I could give you is to not worry about them. Whatsoever. They're bad coding practice. In addition they almost got wiped out in PHP 6, though it appears they're keeping them for now, with any luck they should be completely gone a few version releases afterwards.
delayedinsanity is offline  
Reply With Quote
Old 11-09-2009, 11:36 PM   #4 (permalink)
The Addict
 
adamdecaf's Avatar
 
Join Date: May 2009
Posts: 287
Thanks: 5
adamdecaf is on a distinguished road
Default

Quote:
Originally Posted by delayedinsanity View Post
As for short tags, the best answer I could give you is to not worry about them. Whatsoever. They're bad coding practice. In addition they almost got wiped out in PHP 6, though it appears they're keeping them for now, with any luck they should be completely gone a few version releases afterwards.
I really wish that PHP 6 would have taken them out, they are horrible practice.

PHP Code:
<a href="<?php echo $link?>">Click Here!</a>

// vs..

<a href="<?=$link;?>">Click here</a>
It's harder to read the second and more trouble. I was helping someone learn PHP and they were trying to start every script with either <?=php or <?=.
__________________
My Site
adamdecaf is offline  
Reply With Quote
Old 11-10-2009, 01:14 AM   #5 (permalink)
how quixotic are you?
 
ETbyrne's Avatar
 
Join Date: Dec 2007
Location: Lapeer, MI
Posts: 445
Thanks: 37
ETbyrne is on a distinguished road
Default

Thanks for the clarification di!
__________________
Dingo Web Systems > http://www.dingocode.com
My Website > http://www.evanbot.com
ETbyrne is offline  
Reply With Quote
Old 11-10-2009, 06:46 AM   #6 (permalink)
The Contributor
 
Join Date: Apr 2008
Location: Nevada, USA
Posts: 52
Thanks: 10
h0ly lag is on a distinguished road
Default

Sorry, that is what I meant originally as well. Alternative conditional structures.
__________________
Send a message via AIM to h0ly lag Send a message via MSN to h0ly lag
h0ly lag is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Replace special chars not tags, php trigered by html Peuplarchie General 0 09-20-2009 03:32 PM
file_get_contents with PHP tags hello-world Absolute Beginners 4 03-30-2009 09:32 PM
Wordpress tags some show some donīt EyeDentify General 0 01-19-2009 08:21 PM
Designing a tagging system Alan @ CIT Advanced PHP Programming 4 03-10-2008 04:25 PM
HTML tags xenon Advanced PHP Programming 3 02-02-2008 04:30 PM


All times are GMT. The time now is 05:18 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design