Re: calling function from function?
| From: | Greg Donald | Date: | Thu, 11 Nov 2004 19:41:23 +0000 |
| Subject: | Re: calling function from function? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-201786@lists.php.net to get a copy of this message | ||
On Thu, 11 Nov 2004 12:26:17 -0700, Jason <jason.gerfen@scl.utah.edu> wrote:
> function db( $host, $user, $pass, $dbnam ) {
> $db = @mysql_pconnect( $host, $user, $pass )or die( mysql_error( $db ));
> @mysql_select_db( $dbnam )or die( mysql_error( $db ) );
> return $db;
> }
>
> function logs() {
If you plan to pass parameters to this function you should probbaly define them:
function logs( $var1 ) {
There are built-in PHP functions that assist with handling variable
function parameters such as func_get_arg(), func_get_args(), and
func_num_args() if you don't want to pre-define any however.
> global $defined;
>
> db( $defined[9], $defined[1], $defined[2], $defined[3] );
> ... do some processing ...
What does print_r( $defined ) show you? Is that what you expect to be
in the array?
--
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/