Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Diffrence between print_r and echo in PHP

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 316
    Comment on it

    Although the syntax echo and print in php is almost do same function. On the performance based work there are some difference between then:-

    1. Echo is much faster in performance than Print, Since it will not return any value.
    2. On the basis of multiple print the result

    Echo syntax can print multiple params lets see the example below:-

     echo  "printing count ", 22, 33, 44;  
    

    As you can see I can print multiple segment using the same syntax in same line

    echo ("printing count ", 22, 33, 44");      
    

    Now above you can see I'm printing using one single param string. Now case of print:- print() can only take one parameter:

      print ("printing count ", 22, 33, 44");
    

    In above line you noticed I'm strict to use only one param using one syntax print in same line

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: