manage a string for take namefile

manage a string for take namefile

am 03.10.2007 03:10:58 von artev

if by PHP_SELF
I have some similar:
/localhost/namefile.php
is possible to extract only this :
namefile.php

(is possible also have only namefile -no extension-)

or is there a specific function?

Re: manage a string for take namefile

am 03.10.2007 03:48:12 von Steve

"artev" wrote in message
news:fg6v3b3760c9.4su5n243fc2h.dlg@40tude.net...
> if by PHP_SELF
> I have some similar:
> /localhost/namefile.php
> is possible to extract only this :
> namefile.php
>
> (is possible also have only namefile -no extension-)
>
> or is there a specific function?

pathinfo

Re: manage a string for take namefile

am 03.10.2007 18:34:37 von Shion

artev wrote:
> if by PHP_SELF
> I have some similar:
> /localhost/namefile.php
> is possible to extract only this :
> namefile.php

pathinfo()
http://www.php.net/manual/en/function.pathinfo.php

> (is possible also have only namefile -no extension-)
>
> or is there a specific function?

basename(), if you know the extention
http://www.php.net/manual/en/function.basename.php

list($filename,$extension)=explode('.',$file);
if you are sure there is only one '.' in the files name.

--

//Aho