By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,982 Members | 1,738 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,982 IT Pros & Developers. It's quick & easy.

using __FILE__

P: n/a
Hi everyone,

I want to create a script that will determine where in an array or
database to find information based on the name of the file. I have
the reference working, but it's giving me too much information.

<?
$f = __FILE__;
print $f
?>

gives me

/home/calador/public_html/wapolitics/counties/adams.php

All I want is "adams".

Any ideas?

Chad Lupkes
ch********@earthlink.net
Jul 17 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
On 22 Nov 2003 16:21:04 -0800, Chad Lupkes wrote:
Hi everyone,

I want to create a script that will determine where in an array or
database to find information based on the name of the file. I have
the reference working, but it's giving me too much information.

<?
$f = __FILE__;
print $f
?>

gives me

/home/calador/public_html/wapolitics/counties/adams.php

All I want is "adams".

Any ideas?

Chad Lupkes
ch********@earthlink.net


All your basename() are quite helpful in this instance...

For more information:
http://us4.php.net/manual/en/function.basename.php

--
-- Rudy Fleminger
-- sp@mmers.and.evil.ones.will.bow-down-to.us
(put "Hey!" in the Subject line for priority processing!)
-- http://www.pixelsaredead.com
Jul 17 '05 #2

P: n/a
I noticed that Message-ID: <np******************************@40tude.net>
from FLEB contained the following:
All your basename() are quite helpful in this instance...

All your basename() are belong to us...
--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 17 '05 #3

P: n/a
Hi Rudy,

I found that, and it helped. I just posted another question about arrays as
a follow up.

Thanks!

--
Chad Lupkes
ch********@yahoo.com
http://www.seattlewebcrafters.com/
"FLEB" <so*********@mmers.and.evil.ones.will.bow-down-to.us> wrote in
message news:np******************************@40tude.net.. .
On 22 Nov 2003 16:21:04 -0800, Chad Lupkes wrote:
Hi everyone,

I want to create a script that will determine where in an array or
database to find information based on the name of the file. I have
the reference working, but it's giving me too much information.

<?
$f = __FILE__;
print $f
?>

gives me

/home/calador/public_html/wapolitics/counties/adams.php

All I want is "adams".

Any ideas?

Chad Lupkes
ch********@earthlink.net


All your basename() are quite helpful in this instance...

For more information:
http://us4.php.net/manual/en/function.basename.php

--
-- Rudy Fleminger
-- sp@mmers.and.evil.ones.will.bow-down-to.us
(put "Hey!" in the Subject line for priority processing!)
-- http://www.pixelsaredead.com

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.543 / Virus Database: 337 - Release Date: 11/21/2003
Jul 17 '05 #4

P: n/a
> All your basename() are belong to us...

HAH. I was thinking the same thing! :)
Jul 17 '05 #5

P: n/a
Regarding this well-known quote, often attributed to timmeh's famous "Sun,
23 Nov 2003 06:01:47 GMT" speech:
All your basename() are belong to us...


HAH. I was thinking the same thing! :)

Um... that was the pun :)

--
-- Rudy Fleminger
-- sp@mmers.and.evil.ones.will.bow-down-to.us
(put "Hey!" in the Subject line for priority processing!)
-- http://www.pixelsaredead.com
Jul 17 '05 #6

P: n/a
I noticed that Message-ID:
<1m*******************************@40tude.net> from FLEB contained the
following:
All your basename() are belong to us...


HAH. I was thinking the same thing! :)

Um... that was the pun :)


Oops.<blush>

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 17 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.