Unfamiliar with this syntax. Any help?

Discussion in 'PHP' started by ChaosFoo, Jan 28, 2008.

  1. #1
    I have tried searching for an answer to this, but I really don't know what kind of search strings will get me the results that I need.

    I'm working on a PHP file that another person at my company coded. This person no longer works here so I can't ask him about it.

    Here is the code:

    
    <?=$metaTags;?>
    Code (markup):
    I have a strictly HTML file, and then this code is in the 'head' tag. It basically prints the meta tags for that particular page.

    I know what it does, but I have never seen syntax like this. It seems to me that it should be invalid PHP code. However, this

    <?php=$metaTags;?>
    Code (markup):
    throws an error.

    Does anyone know where I can learn more about this syntax, and its use?
     
    ChaosFoo, Jan 28, 2008 IP
  2. CreativeClans

    CreativeClans Peon

    Messages:
    128
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #2
    It's short hand for

    
    <?php echo $metaTags; ?>
    PHP:
     
    CreativeClans, Jan 28, 2008 IP
  3. ChaosFoo

    ChaosFoo Peon

    Messages:
    232
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks! Do you know where I can read up on this shorthand method as well as any others?
     
    ChaosFoo, Jan 28, 2008 IP