shazman Posted February 29, 2008 Share Posted February 29, 2008 Say I have a string of numbers like this: 1,4,7,2 and I want to check if 4 is in that string, how would I do that? Thank you. EDIT: If it's easier to solve, I could have the string be just numbers: 1472 Quote Link to comment https://forums.phpfreaks.com/topic/93620-solved-find-certain-number-in-string-of-numbers/ Share on other sites More sharing options...
tippy_102 Posted February 29, 2008 Share Posted February 29, 2008 strpos is what you need. There is an example on this page: http://ca.php.net/strpos Quote Link to comment https://forums.phpfreaks.com/topic/93620-solved-find-certain-number-in-string-of-numbers/#findComment-479701 Share on other sites More sharing options...
shazman Posted February 29, 2008 Author Share Posted February 29, 2008 Thanks. That's just what I was looking for. Quote Link to comment https://forums.phpfreaks.com/topic/93620-solved-find-certain-number-in-string-of-numbers/#findComment-479706 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.