2 /* Prototype : proto int strspn(string str, string mask [, int start [, int len]])
3 * Description: Finds length of initial segment consisting entirely of characters found in mask.
4 If start or/and length is provided works like strspn(substr($s,$start,$len),$good_chars)
5 * Source code: ext/standard/string.c
6 * Alias to functions: none
9 error_reporting(E_ALL
& ~E_NOTICE
);
12 * Testing strspn() : with different unexpected values for mask argument
15 echo "*** Testing strspn() : with diferent unexpected values of mask argument ***\n";
22 //get an unset variable
28 public function __toString() {
33 // creating a file resource
34 $file_handle = fopen(__FILE__
, 'r');
37 //array of values to iterate over
58 array('color' => 'red', 'item' => 'pen'),
87 // loop through each element of the array for mask
89 foreach($values as $value) {
90 echo "\n-- Iteration with mask value as \"$value\" --\n";
91 var_dump( strspn($str,$value) ); // with defalut args
92 var_dump( strspn($str,$value,$start) ); // with default len value
93 var_dump( strspn($str,$value,$start,$len) ); // with all args