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. Link to comment https://forums.phpfreaks.com/topic/142321-solved-finding-a-digit-in-a-string/ 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 Link to comment https://forums.phpfreaks.com/topic/142321-solved-finding-a-digit-in-a-string/#findComment-745730 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 Link to comment https://forums.phpfreaks.com/topic/142321-solved-finding-a-digit-in-a-string/#findComment-745732 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.