Re: How can I make this smaller

From: Date: Mon, 02 Apr 2001 22:51:04 +0000
Subject: Re: How can I make this smaller
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-47335@lists.php.net to get a copy of this message
Cool, not my thread, but i never knew about the list function. /me needs to read up an arrays more i guess ----- Original Message ----- From: "Matt McClanahan" <cardinal@dodds.net> To: "Richard Kurth" <rkurth@pacifier.com> Cc: "PHP" <php-general@lists.php.net> Sent: Thursday, April 05, 2001 6:56 PM Subject: Re: [PHP] How can I make this smaller > On Thu, Apr 05, 2001 at 01:40:54PM -0700, Richard Kurth wrote: > > > Is there another way to write this I would like to make it smaller > > also How would I write it so it is a function and I would be able to use all > > the data throughout the whole program every time I try the rest of the > > program does not see the data > > > $domain=$data[0]; > > $tld=$data[1]; > > $firstname=$data[2]; > > $lastname=$data[3]; > > $userid=$data[4]; > > $passw=$data[5]; this part would like to make smaller > > $email=$data[6]; > > $package=$data[7]; > > $frontpage=$data[8]; > > $mysql=$data[9]; > > $userdatabase=$data[10]; > > $newuser =$data[11]; > > $newuserpass =$data[12]; > > Use list() > > list($domain,$tld,$firstname,$lastname,$userid,.....) = $data; > > If you want to put it in a function, declare them all globals beforehand. > > function myfunc() > { > global $domain,$tld,$firstname,$lastname,$userid...; > > Matt > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > >

« previous php.general (#47335) next »