[PHP] newbie: string manipulation

2002-04-24 Thread ROBERT MCPEAK
I need code that grabs the file at the end of a file path. I have this: /usr/blah/doh/yuck/wow/abigfile.html And would like to return this: abigfile.html Could somebody show me how to do this? Thank you! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] newbie: string manipulation

2002-04-24 Thread Erik Price
On Wednesday, April 24, 2002, at 04:04 PM, ROBERT MCPEAK wrote: I need code that grabs the file at the end of a file path. I have this: /usr/blah/doh/yuck/wow/abigfile.html And would like to return this: abigfile.html Could somebody show me how to do this?

Re: [PHP] newbie: string manipulation

2002-04-24 Thread Jason Wong
On Thursday 25 April 2002 04:04, ROBERT MCPEAK wrote: I need code that grabs the file at the end of a file path. I have this: /usr/blah/doh/yuck/wow/abigfile.html And would like to return this: abigfile.html Manual Filesystem functions -- Jason Wong - Gremlins Associates -

Re: [PHP] newbie: string manipulation

2002-04-24 Thread Pushkar Pradhan
Try this, not the most efficient way. $names = explode(/, /usr/blah/); last_element = sizeof($names)-1; $name[last_element] = abigfile I need code that grabs the file at the end of a file path. I have this: /usr/blah/doh/yuck/wow/abigfile.html And would like to return this:

Re: [PHP] newbie: string manipulation

2002-04-24 Thread Alex Piaz
Try this: $file = /usr/blah/doh/yuck/wow/abigfile.html; $file = basename($file); It will returns abigfile.html That´s it Regards Alex At 16:04 24/4/2002 -0400, ROBERT MCPEAK wrote: I need code that grabs the file at the end of a file path. I have this: /usr/blah/doh/yuck/wow/abigfile.html