![]() |
Gah.. Regex?
Hi,
If i have a file named something (123).jpg, where 123 is an integer, is there a way where I can get the integer to use in the rest of my script? I think its regex- not sure though. Thanks for any help :) |
|
php Code:
|
Thanks, but the problem is I only need part of the filename, specifically the part between the () (but not including them)...
|
php Code:
|
I love you wildhoney- could you explain or point me in the right direction the preg_replace you gave me? Its greek to me (although funnily enough i did actually study greek...)...!
|
Oh, your file is named 'something(123).jpg' not '123.jpg'.
I misunderstood. -m |
Its my fault, i should have made myself clearer :)
|
All it means is anything that's not an integer (^\d -- ^ being not, and \d meaning digit) should be replaced with
null. |
Ahh, too easy! Thanks.
|
| All times are GMT. The time now is 06:04 AM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0