Jump to content

stristr help


bmdsherman

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.