Re: searching through a string

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ron Piggott (PHP) wrote:
If $file_name includes the path
/path/to/file/file_name.pdf
is there anyway of searching from the right hand side to the left and
getting the file name out the $file_name variable?  The file name starts
the character following the last /

this should do it.
$filename=preg_replace('/.*\//','',$filename);

Kae

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux