note 76184 deleted from function.strpbrk by cmb

From: Date: Sat, 16 Nov 2019 14:50:35 +0000
Subject: note 76184 deleted from function.strpbrk by cmb
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-213060@lists.php.net to get a copy of this message
Note Submitter: Evan ---- If you're not looking to duplicate the rest of the string, but instead just want the offset, in the spirit of the str*pos() functions: <?php function strpbrkpos($s, $accept) { $r = FALSE; $t = 0; $i = 0; $accept_l = strlen($accept); for ( ; $i < $accept_l ; $i++ ) if ( ($t = strpos($s, $accept{$i})) !== FALSE ) if ( ($r === FALSE) || ($t < $r) ) $r = $t; return $v; } ?>

« previous php.notes (#213060) next »