bird_man11 Posted September 20, 2007 Share Posted September 20, 2007 Hi guys, i have an array that i want to search for example $aacnbri = array("D99992001", "D00231119", "D99992100", "D00129123"); the first character is known and the last 4 digits are known, but the middle 4 arn't known i was wondering how would i go about this, is there any way of using array_search() or in_array() with a wildcard? e.g "D****2001" cheers Quote Link to comment Share on other sites More sharing options...
Jessica Posted September 20, 2007 Share Posted September 20, 2007 I think you'll have to use regular expressions for this. Quote Link to comment Share on other sites More sharing options...
bird_man11 Posted September 21, 2007 Author Share Posted September 21, 2007 yeah i have tried using in_array('/D[0-9]{4}2001/', $aacnbri); and array_search('/D[0-9]{4}2001/', $aacnbri); but they do not seem to work, i will just have to loop the array and use preg_match() 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.