Re: Function

From: Date: Wed, 22 May 2002 14:02:55 +0000
Subject: Re: Function
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-98681@lists.php.net to get a copy of this message
Hi there!, When you include information from an include file, PHP treats the text as inline code if you use the include() function. In other words, if you use code like this: <?php include 'file.php'; ?> Then any functions inside file.php will be available just as if you'd copy/pasted them in. If file.php contained: function echoThis($this_text){ echo($this_text); } then you could type <?php include 'file.php'; echoThis("I am some text"); ?> and whatever echoThis() is coded to do will happen just as if the file looked like this: <?php function echoThis($this_text){ echo($this_text); } echoThis("I am some text"); ?> For more information, see http://www.php.net/manual/en/function.include.php HTH, Dw Sqlcoders.com Dynamic data driven web solutions ----- Original Message ----- From: "Rodrigo" <tagzero@tagzero.com> To: "'Php Lista'" <php-general@lists.php.net> Sent: May 21 2002 08:48 PM Subject: [PHP] Function Hi guys I'm trying to use a function on na .inc file, how should I do? How should I write the function and what should I write on the file so that the function file is "Included" to be used on a function call on the php file? I appreciate any kind of sample code. Thanx, Rodrigo de Oliveira Costa

« previous php.general (#98681) next »