+ Post New Thread
Results 1 to 2 of 2

Thread: what is the difference between echo and print command in php?

  1. #1
    Banned
    Join Date
    Apr 2017
    Posts
    12

    what is the difference between echo and print command in php?



    what is the difference between echo and print command in php?

  2. #2
    Junior Member michral's Avatar
    Join Date
    May 2017
    Posts
    25


    Is this useful / helpfull? Yes | No
    PHP*echo*and*print*both are PHP Statement.
    Both are used to display the output in PHP.
    echo
    1. echo is a statement i.e used to display the output. it can be used with parentheses echo or without parentheses echo.
    2. echo can pass multiple string separated as ( , )
    3. echo doesn’t return any value
    4. echo is faster then print


    Example:

    <?php
    $name="Ravi";
    echo $name;
    //or
    echo ($name);
    ?>


    Print
    1. Print is also a statement i.e used to display the output. it can be used with parentheses print( ) or without parentheses print.
    2. using print can doesn’t pass multiple argument
    3. print always return 1
    4. it is slower than echo


    Example:

    <?php
    $name="Ravi";
    print $name;
    //or
    print ($name);
    ?>

+ Post New Thread

Similar Threads

  1. Difference between SEM and SEO
    By Garnett Simpkin in forum General Talk
    Replies: 3
    Last Post: 09-19-2019, 11:51 AM
  2. What is difference between Seo and Smo..?
    By Sonamkumari in forum SEO - Search Engine Optimisation
    Replies: 5
    Last Post: 08-02-2017, 10:57 AM
  3. [GET] Woocommerce Print Invoices & Packing lists v2.4.4 Plugin
    By Ross Crumpler in forum Wordpress Themes
    Replies: 0
    Last Post: 01-08-2015, 08:36 AM
  4. What is the difference between .com and .info
    By Fli in forum Domain names
    Replies: 0
    Last Post: 03-16-2013, 10:53 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
 Protected by : ZB BLOCK  &  StopForumSpam