You are here: Re: preg_match() « All PHP « IT news, forums, messages
Re: preg_match()

Posted by Janwillem Borleffs on 09/28/13 11:41

Steve wrote:
> I need to find what that text greater than one charactor appears
> after the last / in a string and ignor any file extention that may
> appear at the end of the string.
>
> example $string = "/foldername/anotherfoldername/file.txt";
>
> I was told to use preg_match() but havent a clue on what i am doing?
>

Sounds like you want the file name. For this, simply use basename():

$filename = basename($string);


JW

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация