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 Link to comment https://forums.phpfreaks.com/topic/89330-solved-regex-s/ Share on other sites More sharing options...
jk11uk Posted February 4, 2008 Author Share Posted February 4, 2008 Please need help asap on this Link to comment https://forums.phpfreaks.com/topic/89330-solved-regex-s/#findComment-457451 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} Link to comment https://forums.phpfreaks.com/topic/89330-solved-regex-s/#findComment-457463 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.