473,397 Members | 2,028 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

<?= and <?php and <?

What are the differences between using these?

<?= and <?php and <?

Jul 17 '05 #1
6 1502
Only "<?php" is enabled on *all* servers

to use the others, short_open_tags must be "On" in php.ini.
"<?=$variable?>" is equivalent to "<?php echo $variable ?>"

Jul 17 '05 #2
An anonymous being wrote:
What are the differences between using these?

<?= and <?php and <?


The differences are outlined in the Manual, together with
recommendations on which to use.

http://www.php.net/manual/en/language.basic-syntax.php

--
Jock
Jul 17 '05 #3
*** ub****@gmail.com escribió/wrote (27 Jan 2005 11:50:33 -0800):
What are the differences between using these?

<?= and <?php and <?


<? is shorthand for <? echo

The PHP manual explains it better than I could:

"There are four sets of tags which can be used to denote blocks of PHP
code. Of these, only two (<?php. . .?> and <script language="php">. .
..</script>) are always available; the others can be turned on or off from
the php.ini configuration file. While the short-form tags and ASP-style
tags may be convenient, they are not as portable as the longer versions.
Also, if you intend to embed PHP code in XML or XHTML, you will need to use
the <?php. . .?> form to conform to the XML."

http://es2.php.net/manual/en/language.basic-syntax.php

The <script> alternative exists because of certain issues with some HTML
editors such us Front Page.

--
-+ Álvaro G. Vicario - Burgos, Spain
+- http://www.demogracia.com (la web de humor barnizada para la intemperie)
++ Manda tus dudas al grupo, no a mi buzón
-+ Send your questions to the group, not to my mailbox
--
Jul 17 '05 #4
Thanks...this is a big help.
Just wondering, in the future, how do you recommend me to search for
answers to syntax related questions? For example, Google does not
allow searches such as '<?='.

Thanks

Matt L

Jul 17 '05 #5
*** ub****@gmail.com escribió/wrote (27 Jan 2005 13:07:51 -0800):
Just wondering, in the future, how do you recommend me to search for
answers to syntax related questions? For example, Google does not
allow searches such as '<?='.


The PHP manual is a great source of information:

http://www.php.net/manual/en/
http://www.php.net/download-docs.php

I recommend the "Extended HTML Help" download if you are a Windows user.
Most of your questions are probably covered in the "Language Reference"
chapter:

http://www.php.net/manual/en/langref.php

The rest is just a matter of intuition and common sense. Since you
absolutely need to use <? to execute any code, that must be explained in
the very first page :)

--
-+ Álvaro G. Vicario - Burgos, Spain
+- http://www.demogracia.com (la web de humor barnizada para la intemperie)
++ Manda tus dudas al grupo, no a mi buzón
-+ Send your questions to the group, not to my mailbox
--
Jul 17 '05 #6
<?= is enabled by default in PHP, is a shortcut for print a variable
content or a functions return. It's just like the ASP <%=
Regards,
Ramiro Varandas Jr.

Jul 17 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Christian Schmidbauer | last post by:
Hello! I prepare my XML document like this way: ------------------------------------------------------- PrintWriter writer; Document domDocument; Element domElement; // Root tag
4
by: matatu | last post by:
Hi to all, I have a xml file, a substring like: &lt;a href=&quot;#&quot;&gt;text&lt;/a&gt; which after an xslt trasform is rendered as (using xsl:output method html): &lt;a...
2
by: Eshrath | last post by:
Hi, What I am trying to do: ======================= I need to form a table in html using the xsl but the table that is formed is quite long and cannot be viewed in our application. So we are...
2
by: Donald Firesmith | last post by:
I am having trouble having Google Adsense code stored in XSL converted properly into HTML. The <> unfortunately become &lt; and &gt; and then no longer work. XSL code is: <script...
4
by: higabe | last post by:
Three questions 1) I have a string function that works perfectly but according to W3C.org web site is syntactically flawed because it contains the characters </ in sequence. So how am I...
34
by: Mark Moore | last post by:
It looks like there's a pretty serious CSS bug in IE6 (v6.0.2800.1106). The HTML below is validated STRICT HTML 4.01 and renders as I would expect in Opera, FrontPage, and Netscape. For some...
11
by: Les Paul | last post by:
I'm trying to design an HTML page that can edit itself. In essence, it's just like a Wiki page, but my own very simple version. It's a page full of plain old HTML content, and then at the bottom,...
10
by: Jon Noring | last post by:
Out of curiosity, may a CDATA section appear within an attribute value with datatype CDATA? And if so, how about other attribute value datatypes which accept the XML markup characters? To me,...
9
by: Eric Lindsay | last post by:
I can't figure how to best display little snippets of shell script using <pre>. I just got around to organising to bulk validate some of my web pages, and one of the problems occurs with Bash...
6
by: tentstitcher | last post by:
Hi all: I have a source xml document with an element of type string. This element contains something like the following: <stringData> &lt;Header&gt; &lt;Body&gt; </stringData> I would like to apply an...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.