iversonm Posted August 16, 2008 Share Posted August 16, 2008 if i wanted to use substr_count() but i want my $needle to be an array how would i do this? is it even possible Link to comment https://forums.phpfreaks.com/topic/119966-count-using-array/ Share on other sites More sharing options...
gerkintrigg Posted August 16, 2008 Share Posted August 16, 2008 $needle=array(1,2,3,4); like that? Link to comment https://forums.phpfreaks.com/topic/119966-count-using-array/#findComment-617989 Share on other sites More sharing options...
iversonm Posted August 16, 2008 Author Share Posted August 16, 2008 yep Link to comment https://forums.phpfreaks.com/topic/119966-count-using-array/#findComment-617990 Share on other sites More sharing options...
Barand Posted August 16, 2008 Share Posted August 16, 2008 is it even possible No, needle and haystack both need to be strings. Why not tell us what you are trying to do? Link to comment https://forums.phpfreaks.com/topic/119966-count-using-array/#findComment-618063 Share on other sites More sharing options...
iversonm Posted August 16, 2008 Author Share Posted August 16, 2008 i have a form where users can submit something and i want it to check to see if there is any vulgar language in the entry they are submitting soo so $entry was what they submitted and i was thinking something like this $look = the array of bad words im not going to type; if((substr_count($entry, $look))>0){ return to page and give warning}else{ submit the data} does that help alittle? Link to comment https://forums.phpfreaks.com/topic/119966-count-using-array/#findComment-618132 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.