Find a simple regular expression/file/upload/201212/24/18-51-40-65-61.jpg.thumb.jpg/file/upload/201212/24/18-51-40-65-61.jpg.thumb.png/file/up to find a simple regular expression
/File/upload/201212/24/18-51-40-65-61.jpg.thumb.jpg
/File/upload/201212/24/18-51-40-65-61.jpg.thumb.png
/File/upload/201212/24/18-51-40-65-61.jpg.thumb.gif
..........
The above is the file name. now I want to use the above file name in the following format:
/File/upload/201212/24/18-51-40-65-61.jpg
/File/upload/201212/24/18-51-40-65-61.jpg
/File/upload/201212/24/18-51-40-65-61.jpg
Is to replace the following with null.
.Thumb.jpg
.Thumb.png
.Thumb.gif
------ Solution --------------------
$ S = <
/File/upload/201212/24/18-51-40-65-61.jpg.thumb.jpg
/File/upload/201212/24/18-51-40-65-61.jpg.thumb.png
/File/upload/201212/24/18-51-40-65-61.jpg.thumb.gif
Html;
Echo preg_replace ('/\. thumb \... + $/M', '', $ s );