difference betbeen...............

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • anis2007
    New Member
    • Oct 2006
    • 21

    #1

    difference betbeen...............

    Hi to all of you,

    Plz tell me, exact diff......

    1. What is the difference between include() and include_once().
    OR require() and require_once().
    2.diff in echo() and print();
    Last edited by anis2007; Oct 6 '06, 11:15 AM. Reason: for right question
  • vssp
    Contributor
    • Jul 2006
    • 268

    #2
    The require() statement includes and evaluates the specific file.

    The require_once() statement includes and evaluates the specified file during the execution of the script.

    print() is not actually a real function (it is a language construct) so you are not required to use parentheses with its argument list.

    echo() is not actually a function (it is a language construct) so you are not required to use parentheses with it. In fact, if you want to pass more than one parameter to echo, you must not enclose the parameters within parentheses.

    vssp

    Comment

    • bevort
      New Member
      • Jul 2006
      • 53

      #3
      Originally posted by anis2007
      Hi to all of you,

      Plz tell me, exact diff......

      1. What is the difference between include() and include_once().
      OR require() and require_once().
      2.diff in echo() and print();

      Include_once is used to stop PHP from including the same file over and over again if you happen to call this file in ie a while loop. If you realy have to include some code in a while loop than you must use this statement.

      for a short description about the differance between go to <a href="http://www.faqts.com/knowledge_base/view.phtml/aid/1/fid/40">http://www.faqts.com/knowledge_base/...l/aid/1/fid/40 </a>

      It is by the way always better to enclose all parameters for the echo statement insite paranteses. It make code more readable

      Comment

      Working...