RE: [PHP-DB] Function problem???

From: Date: Sat, 11 Aug 2001 17:00:23 +0000
Subject: RE: [PHP-DB] Function problem???
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-11246@lists.php.net to get a copy of this message
If you have a function Function myFunc ($data) { Some code that generates $moredata; You have to return the $moredata Return ($moredata,$maybemore........); } now you can call the function with list($data1,$data2) = myFunc($code); and have the data in $data1 and $data2 /Mattias aka BoNzO http://bonzo.sineleven.nu -----Original Message----- From: Dreamvale [mailto:dreamvale@dreamvale.com] Sent: den 11 augusti 2001 18:11 To: Brian Grayless; PHP DB list (E-mail) Subject: Re: [PHP-DB] Function problem??? If you have more functions in library file you intend to include.. there's error in syntax.. that is you're having functions within a the Includ_Lib function. If you have variables in the library file, they're local within the Include_Lib function, and hence will not be available out of it, and in fact, will be destroyed as soon as the function is done. In other words, the concept wont work. Just do an include at which ever point you need it, but do it only once per script. Dreamvale ----- Original Message ----- From: "Brian Grayless" <bgrayless@Premier-Resorts.com> To: "PHP DB list (E-mail)" <php-db@lists.php.net> Sent: Saturday, August 11, 2001 12:04 AM Subject: [PHP-DB] Function problem??? > Anybody know what might be wrong with this function? > > My first version of the function was... > > function Include_Lib($libFile) > { > include(LIB_DIR.$libFile); > } > > but it didn't work so I simplied it... > > function Include_Lib() > { > include("/path/generic_vars.phpi"); > } > // Function call > Include_Lib(); > > > and it still doesn't work????? HELP!! I can't figure out what I'm missing??? > I have this included in a file that is also included. Would that cause a > problem??? > > B R I A N G R A Y L E S S > Web Administrator > Premier Resorts > www.premier-resorts.com > > P: 435-655-4812 > F: 413-618-1518 > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net > For additional commands, e-mail: php-db-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net For additional commands, e-mail: php-db-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.db (#11246) next »