Re: 2d array?

From: Date: Thu, 11 Jan 2001 01:49:12 +0000
Subject: Re: 2d array?
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-33860@lists.php.net to get a copy of this message
> $file should be the name of the file - there is a PHP variable for this but > I'm drawing a blank right now. How about __FILE__ ? ;) Note: it's a constant, so make sure you don't try to use a $ before it --Toby ----- Original Message ----- From: "Joe Stump" <jstump@zebulon.miester.org> To: "Kurth Bemis" <kurth@usaexpress.net> Cc: <php-general@lists.php.net> Sent: Wednesday, January 10, 2001 8:46 PM Subject: Re: [PHP] 2d array? > I'll give it a whirl ... > > $array_of_page_titles = array( > 'aboutus.php' => 'All about our company', > 'index.php' => 'Welcome to www.server.com!', > 'foo.php' => 'I\'m a worthless script!' > ); > > Then ... > > <TITLE><? echo $array_of_page_titles[$file]; ?></TITLE> > > $file should be the name of the file - there is a PHP variable for this but > I'm drawing a blank right now. > > --Joe > > On Wed, Jan 10, 2001 at 08:40:21PM -0500, Kurth Bemis wrote: > > i'm confused by the method the go about this. > > > > i want to have a location: home / company / about on a page like > > server.com/company/aboutus.php > > > > i'm thinking that i can use an array containing the page name and then > > search the array and return the page title. now - how do i do this with an > > array? I know that i've seen it done like aboutus.php:About Company or > > something. Its hard to explain - can anyone help me? > > > > ~kurth > > Kurth Bemis - Network/Systems Administrator, USAExpress.net/Ozone Computer > > > > People disagree with me. I just ignore them. > > -- Linus Torvalds, regarding the use of C++ for the Linux kernel > > > > kurth@usaexpress.net | http://www.usaexpress.net/kurth > > PGP key available - http://www.usaexpress.net/kurth/pgp > > > > Fight Weak Encryption! Donate your wasted CPU cycles to Distributed.net > > (http://www.distributed.net) > > > > > > -- > > 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 > > -- > > Joe Stump, PHP Hacker > joestump98@yahoo.com > http://www.miester.org/ > > > -- > 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 (#33860) next »