note 76184 added to function.strpbrk

From: Date: Wed, 04 Jul 2007 03:33:06 +0000
Subject: note 76184 added to function.strpbrk
Groups: php.notes 
Request: Send a blank email to php-notes+get-128216@lists.php.net to get a copy of this message
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; } ?> ---- Server IP: 64.71.164.2 Probable Submitter: 68.111.223.25 ---- Manual Page -- http://www.php.net/manual/en/function.strpbrk.php Edit -- https://master.php.net/note/edit/76184 Del: integrated -- https://master.php.net/note/delete/76184/integrated Del: useless -- https://master.php.net/note/delete/76184/useless Del: bad code -- https://master.php.net/note/delete/76184/bad+code Del: spam -- https://master.php.net/note/delete/76184/spam Del: non-english -- https://master.php.net/note/delete/76184/non-english Del: in docs -- https://master.php.net/note/delete/76184/in+docs Del: other reasons-- https://master.php.net/note/delete/76184 Reject -- https://master.php.net/note/reject/76184 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#128216) next »