bmdsherman Posted August 27, 2009 Share Posted August 27, 2009 How can I make something like this work? <?php if(!stristr($haystack[0], $needle, $needle2, $needle3............)){ Thanks for the help! Link to comment https://forums.phpfreaks.com/topic/172185-stristr-help/ Share on other sites More sharing options...
ignace Posted August 27, 2009 Share Posted August 27, 2009 function my_stristr() { $matches = array(); if (2 <= func_num_args()) { $args = func_get_args(); $haystack = array_shift($args); $needles = $args; foreach ($needles as $needle) { $matches[$needle] = stristr($haystack, $needle); } } return $matches; } $matches = my_stristr($haystack, $needle1, $needle2, $needle3, $needle4); Link to comment https://forums.phpfreaks.com/topic/172185-stristr-help/#findComment-907862 Share on other sites More sharing options...
lemmin Posted August 27, 2009 Share Posted August 27, 2009 Can you be more specific? This can most likely be done using regular expressions. Link to comment https://forums.phpfreaks.com/topic/172185-stristr-help/#findComment-907864 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.