jaymc Posted May 2, 2007 Share Posted May 2, 2007 How can I check of a string containts a number Link to comment https://forums.phpfreaks.com/topic/49571-solved-is-a-string-a-number/ Share on other sites More sharing options...
trq Posted May 2, 2007 Share Posted May 2, 2007 <?php $s = "this is a string with the number 24 in it"; if (preg_match('.[0-9].',$s)) { echo '$s contained a number'; } ?> Link to comment https://forums.phpfreaks.com/topic/49571-solved-is-a-string-a-number/#findComment-243020 Share on other sites More sharing options...
jaymc Posted May 2, 2007 Author Share Posted May 2, 2007 Cheers Link to comment https://forums.phpfreaks.com/topic/49571-solved-is-a-string-a-number/#findComment-243032 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.