PC Nerd Posted January 25, 2009 Share Posted January 25, 2009 Hi, How can I return the digit from the string "file10.gif" ? I have a directory listing of files, and I need to get the digit from the file in order to place it in a database. Thanks. Quote Link to comment Share on other sites More sharing options...
rubing Posted January 25, 2009 Share Posted January 25, 2009 I imagine something like this would work: http://webxadmin.free.fr/article.php?i=387 Quote Link to comment Share on other sites More sharing options...
PC Nerd Posted January 25, 2009 Author Share Posted January 25, 2009 Of course... I looked up the not operator in regex and came up with the following $id = ereg_replace("^[0-9]", "", $file); Thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.