PHP 8.5.0 Alpha 1 available for testing

Voting

: eight minus six?
(Example: nine)

The Note You're Voting On

guillaume dot barranco at free dot fr
7 years ago
A little modification to Evan's code to use an array for the second parameter :

<?php

function strpbrkpos($s, $accept) {
$r = FALSE;
$t = 0;
$i = 0;
$accept_l = count($accept);

for ( ;
$i < $accept_l ; $i++ )
if ( (
$t = strpos($s, $accept[$i])) !== FALSE )
if ( (
$r === FALSE) || ($t < $r) )
$r = $t;

return
$r;
}

?>

<< Back to user notes page

To Top