PHP include

Discussion in 'PHP' started by cancer10, Jul 16, 2008.

  1. #1
    What is the difference between these two?


    1) <?php include "mypage.php";?>

    2) <?php include 'mypage.php';?>




    Thanx
     
    cancer10, Jul 16, 2008 IP
  2. seomarketer

    seomarketer Well-Known Member

    Messages:
    334
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    105
    #2
    W3C states that you should use:

    <?php include("header.php"); ?>

    I will say that you should use that kind of include :)
     
    seomarketer, Jul 16, 2008 IP
  3. TheGreatOne

    TheGreatOne Peon

    Messages:
    53
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Both work fine so thats not a problem
     
    TheGreatOne, Jul 16, 2008 IP
  4. seomarketer

    seomarketer Well-Known Member

    Messages:
    334
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    105
    #4
    @TheGreatOne: yes :) " and '
     
    seomarketer, Jul 16, 2008 IP
  5. Danltn

    Danltn Well-Known Member

    Messages:
    679
    Likes Received:
    36
    Best Answers:
    0
    Trophy Points:
    120
    #5
    Any parsable characters ($variables, \n, \r) etc will be parsed in DOUBLE quotes.

    They will NOT be parsed in single quotes.

    Single quotes are faster - use them - regardless what W3C says.
     
    Danltn, Jul 16, 2008 IP