note 58688 deleted from function.strpos by cmb

From: Date: Sun, 02 Jun 2019 09:02:24 +0000
Subject: note 58688 deleted from function.strpos by cmb
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-211180@lists.php.net to get a copy of this message
Note Submitter: dale at ucsc dot edu ---- if you want need a fast function to find the first occurrence of any ch element of an needle array this function might be of use: <?php $eurl = strpos_needle_array($text, array('"'=>0,'\''=>0,'>'=>0, ' '=>0, "\n"=>0), $surl); function strpos_needle_array(& $text, $needle_ary, $offset=0){ for($ch_pos=$offset;$ch_pos<strlen($text);$ch_pos++){ if(isset($needle_ary[$text[$ch_pos]])){ return $ch_pos; } } return false; } ?>

« previous php.notes (#211180) next »