redarrow Posted February 11, 2007 Share Posted February 11, 2007 if i want to get all the words comming from a form to use the below code what do i do, would i need to implode or explode the blog varable from the form to cheek the words. <?php $check_words=array("<",">","?","@","*","(",")","=","-","_"); foreach($check_words as $word){ if($blog==$word){ echo " soory word wrong"; exit; } } ?> Link to comment https://forums.phpfreaks.com/topic/37990-solved-checking-words-with-inplode-or-explode/ Share on other sites More sharing options...
redarrow Posted February 11, 2007 Author Share Posted February 11, 2007 ok lets make this easer if i make a message like this <?php $words="i love php"; ?> how can i get all the words in $words to be in an array. Link to comment https://forums.phpfreaks.com/topic/37990-solved-checking-words-with-inplode-or-explode/#findComment-181812 Share on other sites More sharing options...
redarrow Posted February 11, 2007 Author Share Posted February 11, 2007 solved it cheers. <?php $word="my name is ? john"; $test=explode(" ",$word); foreach($test as $blog){ $check_words=array("<",">","?","@","*","(",")","=","-","_"); foreach($check_words as $word){ if($blog==$word){ echo " sorry this is not allowed $word please try agin!"; exit; } } } ?> Link to comment https://forums.phpfreaks.com/topic/37990-solved-checking-words-with-inplode-or-explode/#findComment-181815 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.