Results 1 to 2 of 2

Thread: Print Output in PHP..

  1. #1
    Junior Member
    Join Date
    Jul 2010
    Posts
    16
    ΑΡ Credit
    160

    Print Output in PHP..

    PHP is giving some sting functions to printing output into browser and we are often using print() and echo() function. Both of those functions are not real function but a language construction. print() and echo() function have same goal, but there are some essential different that must to pay attention.

    Print() function behavior like the other function in common and having return value integer 1. Thus, print() can used as part of expression which more complex. Meanwhile, echo() is able to accept more than one parameters all at once, and does not having return value.

    Code:
    print() ‘string 1’;
    echo ‘string 1’;
    // using some parameters
    echo ‘string 1’, “string 2”, ‘…’;
    echo() function string will execution more faster than print(). This differentiate caused by will return status (integer) which expose what process has done or not.

    On the other side, echo() just displaying output only and do anything. At implementation, return value status from using function string almost never needed.

  2. #2
    Junior Member
    Join Date
    Sep 2011
    Posts
    2
    ΑΡ Credit
    20
    hey thanks ....have you any tutorial of PHP..or which book or URL i have to follow...i really need to learn this language.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •