PHP function and Keywords used to print on Webpage.



  • echo or echo():- It is a function which print the output on the screen and allow to print multi-value or Strings at a time.



<?php 

$str="Welcome to Learn Computer Tricks and Tips Blog by Rajendra Kumar Yadav."; /* String deceleration */


echo "$str<br>";
echo($str);
echo "<br>Welcome to Blog for learning" . $str;
?>
-------------------------------------------------------------------------------------------------------------
output of the above program code:
Welcome to Learning Computer Tricks and Tips Blog by Rajendra Kumar Yadav.
Welcome to Learning Computer Tricks and Tips Blog by Rajendra Kumar Yadav.
Welcome to Blog of learning Welcome to Learning Computer Tricks and Tips Blog by Rajendra Kumar Yadav.


  • print or print():- It allow to print a message at a time only a single message on the screen.
  • e.g.---

<?php 

$str="Welcome to Learn Computer Tricks and Tips Blog by Rajendra Kumar Yadav."; /* String deceleration */

print "$str<br>";
print($str);
print "<br>Welcome to Blog for learning" . $str; /* illegal operation can not perform the operation */
?>
---------------------------------------------------------------------------------------------------------------
Output:

Welcome to Learn Computer Tricks and Tips Blog by Rajendra Kumar Yadav.
Welcome to Learn Computer Tricks and Tips Blog by Rajendra Kumar Yadav.

Comments

Popular posts from this blog

Assignment 1 Question 3 (Server side and Client Side Scripting)

Install the packages in Linux