RE: [PHP] a stupid question
| From: | Vail, Warren | Date: | Thu, 24 Jun 2004 22:19:14 +0000 |
| Subject: | RE: [PHP] a stupid question | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-189012@lists.php.net to get a copy of this message | ||
Your test that works suggests that the function is "echo"ing its results,
and not actually returning its results. To return its results the function
needs to end with
Function aFunction() {
do something;
Return $resultstring; // very last statement executed in function. <<<<<
}
This should allow
Echo "some string value".aFunction()."another string value";
To work,
Good luck,
Warren Vail
-----Original Message-----
From: Matt Matijevich [mailto:matijevich@alliancetechnologies.net]
Sent: Thursday, June 24, 2004 3:00 PM
To: blake@lhwd.net; php-general@lists.php.net
Subject: Re: [PHP] a stupid question
[snip]
echo "Some text";
aFunction();
echo "Some more text";
[/snip]
What is printed out?
if aFunction() is returning the string "test" then this code: echo "Some
text".aFunction()."some more text"; should print out:
Some texttestsome more text
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php