Solved

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

Posted on 2014-01-07
7
198 Views
Last Modified: 2014-01-07
What does the syntax <?= mean in
<?= $head_script ?>

Open in new window

?
0
Comment
Question by:deleyd
7 Comments
 
LVL 34

Expert Comment

by:gr8gonzo
ID: 39762812
It's shorthand for outputting a value. It's the same as:

<? echo $head_script; ?>
0
 
LVL 27

Assisted Solution

by:yodercm
yodercm earned 50 total points
ID: 39762817
it switches to php, then echoes out the value of the $head_script variable, then switches back to html.
0
 
LVL 109

Accepted Solution

by:
Ray Paseur earned 50 total points
ID: 39762834
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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 34

Expert Comment

by:gr8gonzo
ID: 39762882
Um, okay... I guess having the first right answer doesn't cut it anymore.
0
 
LVL 27

Expert Comment

by:yodercm
ID: 39763575
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
 

Author Comment

by:deleyd
ID: 39763620
My apologies. I'll add weight to the first right answer next time.

Thank you for the answers.
0
 
LVL 34

Expert Comment

by:gr8gonzo
ID: 39763987
It's not a big deal.
0

Featured Post

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question