Solved

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

Posted on 2014-01-07
7
201 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: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 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
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!

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

Expert Comment

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

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
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…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

756 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