Re: a stupid question

From: Date: Fri, 25 Jun 2004 19:10:23 +0000
Subject: Re: a stupid question
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-189079@lists.php.net to get a copy of this message
Everyone Thank you for all the great feedback. Since my function doesnt return data it just echos it to the browser. When I use this format it does not display correctly echo "some text" . aFunction() . "some more text"; If I use the orginal code it displays fine. echo "Some text"; aFunction(); echo "More text"; Thanks for all the help. -B Philip Olson wrote:
I cant figureout the syntax please help echo "Some text".aFunction()."some more text"; The function is not working.
     
Your problem is the paren's echo "'some text' $aFunction 'some more text'"; You need double quotes for the entire string, but single quotes around the text so it knows it is text.
This is very much incorrect, not sure where to begin but please ignore this advice. A string is a string is a string is a string: http://www.php.net/types.string I'm 99% sure the problem is aFunction() is echoing a value as opposed to returning one, this is a common question answered here: http://www.php.net/manual/en/faq.using.php#faq.using.wrong-order If that doesn't answer your question then please post the code. Regarding the subject of this thread you should consider asking smart questions by reading the following in its entirety: http://www.catb.org/~esr/faqs/smart-questions.html Very useful for all parties involved! :) Regards, Philip


« previous php.general (#189079) next »