To display anything in php one can use its inbuilt function 'echo' or 'print'. You can display anything using this keywords whether it is string value or integer value or float value.
How to use ' echo ' function/keyword to display anything
How to use 'print' function/keyword to display anything
Now you are must thinking both the function are same then what is the difference between them. Actually there is no difference between 'echo' and 'print' function but the 'print' function has one limitation. The 'echo' function can work with more than one string or expression at a time but the 'print' function cannot work with more than one string or expression at a time. This will be more clear after seeing the example below.
The 'print' function can display only one string at a time. The speed of 'echo' function is more tan the 'print' function
Apart from this two display function one more display function is available in php Print_r ( ). This function is used to display the array element. See the below example
The above code will show you the output
These three function are mainly available in Php to display data in browser
No comments:
Post a Comment