SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Zealot
    Join Date
    Apr 2008
    Posts
    112
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    what is this:<?= in php ?

    I needed a text editor today so I googled for one and got this one: freerte

    in the example page there was this code:
    Code PHP:
    initRTE('<?= $content; ?>', 'example.css');
    which displayes the texteditor in the page. What I've found interesting about it, is this:
    Code PHP:
    <?=
    i've figure it out this is a replacement for
    Code PHP:
    <?php echo...
    but when I tried to get some answers none of the SEs I've used could came up with anything about it, the php manual gave an "internal Error", so I'm asking you (maybe you know) :
    - what does it mean?
    - is it safe to use it as it is? (I have php 5 installed at home)
    - does it requires short tags on?

    Thank you in advance
    Proud member of this community.
    ____________________________

  2. #2
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,875
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    <?= is the short tag equivalent of <?php echo but it only works when short tags are turned on. Short tags are often turned off now as <? has other uses which can make coding a page harder and more confusing when it is turned on.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  3. #3
    Twitter: @AnthonySterling silver trophy AnthonySterling's Avatar
    Join Date
    Apr 2008
    Location
    North-East, UK.
    Posts
    6,111
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    They are PHP Short-Tags, here's a quick Google result for you.

    It is preferred they are tuned off normally.

    SilverB.

  4. #4
    SitePoint Zealot
    Join Date
    Apr 2008
    Posts
    112
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thank you very much Stephen and SilverB.

    that made it crystal clear. Thanks again
    Proud member of this community.
    ____________________________

  5. #5
    John 8:24 JREAM's Avatar
    Join Date
    Sep 2007
    Location
    Florida
    Posts
    1,508
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've found short tags not so good to use for compatibility, it's best to use whatever is the default settings which is short tags off.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •