
- Forum
- Programming Talk
- PHP
- Return Value
Return Value
This is a discussion on Return Value within the PHP forums, part of the Programming Talk category; I have tried many times echo() function in PHP. But since echo returns the value to screen I get a ...
-
Return Value
I have tried many times echo() function in PHP. But since echo returns the value to screen I get a doubt whether echo() function have a return value associated with it? If so what would be its type. Also if echo have a return value associated with it can we assign this to variable and use it in our PHP script further.
-
Both echo() and echo represents same thing in PHP. This is because of the simple fact that echo is not a function as many of us think. It is actually a language construct. Either syntax holds good and valid with respect to echo in PHP. Coming to your doubt of whether echo returns value. echo surely does not have any return value associated with it. Since it outputs the given
expression or value on screen does not mean that it has return value associated with it. In fact this is the major difference between echo and print(). That is print() is a function and it has a return value associated with it which you can assign to a variable. But in contrast echo is not a function and is a language construct and also does not have a return value associated with it.
«
Trying out PHP and XML
|
In how many ways we can retrieve the date in the result set of mysql using PHP?
»

Reply With Quote





