> $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" <[EMAIL PROTECTED]>
To: "Kurth Bemis" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
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
> >
> > [EMAIL PROTECTED] | 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:
[EMAIL PROTECTED]
> > For additional commands, e-mail:
[EMAIL PROTECTED]
> > To contact the list administrators, e-mail:
[EMAIL PROTECTED]
>
> --
>
> Joe Stump, PHP Hacker
> [EMAIL PROTECTED]
> http://www.miester.org/
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail:
[EMAIL PROTECTED]
> For additional commands, e-mail:
[EMAIL PROTECTED]
> To contact the list administrators, e-mail:
[EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to