SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member YellowKard's Avatar
    Join Date
    Apr 2001
    Location
    Madison, AL
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What is the short way to print varibles (like <? print $var ?>).

    It's like <?: $var ?> or something.

  2. #2
    SitePoint Wizard
    Join Date
    Apr 2000
    Posts
    1,483
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think it is <?php =$var ?> but I'm not sure - it's never something I've used.

  3. #3
    Grumpy Mole Man Skunk's Avatar
    Join Date
    Jan 2001
    Location
    Lawrence, Kansas
    Posts
    2,067
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    <?=$var ?>

  4. #4
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Skunk is correct

    PHP Code:
    //Prints the value of $var
    <?=$var?>

    //Additionally this can be used to print the results ofa function
    <?=addslashes($text)?>
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  5. #5
    SitePoint Enthusiast
    Join Date
    Mar 2001
    Location
    Washington State
    Posts
    70
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Things to keep in mind :
    • It's PHP4+ specific
    • Turning short_open_tag disables this feature. As noted in manual, it must be disabled to run <?xml
    • Not part of PEAR coding standard
    • Not everyone knows what <?= means

    The above are facts but realize it's a personal choice of the programmer whether or not to use short tags.


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
  •