RE: [PHP] functions, opinion...

From: Date: Tue, 17 Jun 2003 13:36:54 +0000
Subject: RE: [PHP] functions, opinion...
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-151828@lists.php.net to get a copy of this message
Hi, > > My personal opinion, which shows in all my code writing is to > never echo > > inside a function. always return the data whether it be string, array, > > or boolean... I've always left echoing up to the actual page > showing the > > data. That way if you have two seperate pages that need to display the > > data differently, you can use the same function, and just format it as > > needed on the pages. This is kind of what I thought would be the majority of the responses. I've found that since the inception of web languages (ASP, PHP, etc) that I've "abused" functions a bit. I then got to thinking one day that maybe what I was doing was normal, but then I figured that it probably wasn't. At times it seems like it caused me to scramble all my logic. -Dan Joseph

« previous php.general (#151828) next »