SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast allusion's Avatar
    Join Date
    Aug 2001
    Location
    San Francisco, CA
    Posts
    39
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    <?=$var?> short tags and xml

    I just 'discoved' this method of calling varibles, where before I had done the much lengthier
    PHP Code:
    <?php
    echo "$var";
    ?>
    // instead of
    <?=$var?>
    Anyway, my question is will this shorter method work if I turn off short start tags in my php conf file? Is there an XML compatible equilvilant. <?php=$var?> doesnt seem to work.

  2. #2
    SitePoint Wizard silver trophy redemption's Avatar
    Join Date
    Sep 2001
    Location
    Singapore
    Posts
    5,269
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by allusion
    Anyway, my question is will this shorter method work if I turn off short start tags in my php conf file? Is there an XML compatible equilvilant. <?php=$var?> doesnt seem to work.
    no the shorter method will not work if you turn off the short tags in php.ini...

    as for an XML compatible equivalent, i've no idea and i've read in some books (a few months back so the info may be obsolete ) that if you're working with XML then you should use the longer "<?php" syntax


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
  •