jk11uk Posted February 4, 2008 Share Posted February 4, 2008 regex is new and very confusing to me so any help is much appreciated..... i need to check if the first 4 values in a string equal ABCD. how do i do this? i think i have to use regex for example, $stringY = "abcdef"; $stingX="abcfgfgr"; ////need to be able to output only $stringY if(string starts with abcd) { echo string } thanks Quote Link to comment Share on other sites More sharing options...
jk11uk Posted February 4, 2008 Author Share Posted February 4, 2008 Please need help asap on this Quote Link to comment Share on other sites More sharing options...
jk11uk Posted February 4, 2008 Author Share Posted February 4, 2008 no worries. sorted. solution: $test=ereg('value', $string_to_test); if($test == true){whatever}else{whatever} 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.