Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

PHP strspn — Finds the length of the initial segment of a string consisting entirely of characters contained within a given mask

<?php
// subject does not start with any characters from mask
var_dump(strspn("foo", "o"));

// examine two characters from subject starting at offset 1
var_dump(strspn("foo", "o", 1, 2));

// examine one character from subject starting at offset 1
var_dump(strspn("foo", "o", 1, 1));
?>
 
PREVIOUS NEXT
Tagged: #PHP #strspn #Finds #length #initial #segment #string #consisting #characters #contained #mask
ADD COMMENT
Topic
Name
6+7 =