Solved

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

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

Open in new window

?
0
Comment
Question by:deleyd
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 35

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:Cornelia Yoder
Cornelia Yoder 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 110

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
Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

 
LVL 35

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:Cornelia Yoder
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 35

Expert Comment

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

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
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…

631 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