RE: [PHP-WIN] Simple function question

From: Date: Thu, 09 May 2002 20:18:33 +0000
Subject: RE: [PHP-WIN] Simple function question
Groups: php.windows 
Request: Send a blank email to php-windows+get-13665@lists.php.net to get a copy of this message
// Setup the function like this function runvar ($var1) { ... } // Call it like this runvar($var1); --- Scott Hurring Systems Programmer EAC Corporation ScottH@eac.com Voice: 201-462-2149 Fax: 201-288-1515 > -----Original Message----- > From: Matt Babineau [mailto:mbabineau@illuminatistudios.com] > Sent: Thursday, May 09, 2002 3:02 PM > To: 'Php-Win (E-mail)' > Subject: [PHP-WIN] Simple function question > > > Ok, I just read a section in a book about functions. In my cost I have > some variables set: > > $var1 = "1"; > > And I have a function I wrote that needs to utilize that variable. > > function runvar() { > query database looking for $var1; > } > > I get horrible errors though. In the book it talked about the local > fuciton scope not being able to communicate with the global scope. How > can I pass $var1 into the function so it can be used?

« previous php.windows (#13665) next »