what is <?= ....?> in PHP

What does the syntax <?= mean in
<?= $head_script ?>

Open in new window

?
deleydAsked:
Who is Participating?
 
Ray PaseurConnect With a Mentor Commented:
It's called the "short echo tag."  Contrast the "short open tag" which you do not want to use because it is configuration-dependent and may cause confusion with XMLdocuments.  The short echo tag can be used rather easily to embed a PHP value in an HTML document.  See also the HEREDOC string.

If you're interested in learning PHP, this article will help you get started:
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/A_11769-And-by-the-way-I-am-new-to-PHP.html
0
 
gr8gonzoConsultantCommented:
It's shorthand for outputting a value. It's the same as:

<? echo $head_script; ?>
0
 
Cornelia YoderConnect With a Mentor ArtistCommented:
it switches to php, then echoes out the value of the $head_script variable, then switches back to html.
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
gr8gonzoConsultantCommented:
Um, okay... I guess having the first right answer doesn't cut it anymore.
0
 
Cornelia YoderArtistCommented:
I agree with you, gr8gonzo, you should have shared the points.  I used to request attention myself when this happened to someone else, and suggest sharing the points, but the last time I did that, the mod took all the points away from me and gave them all to the other person, so I refuse to be generous again.  I suggest you do it ... :)
0
 
deleydAuthor Commented:
My apologies. I'll add weight to the first right answer next time.

Thank you for the answers.
0
 
gr8gonzoConsultantCommented:
It's not a big deal.
0
All Courses

From novice to tech pro — start learning today.