Hello,
I ran into a strange problem today, and I have no clue what is wrong.
Here is the code:
var_dump(strspn('There are 237 monkeys in the house', '1234567890'));
I have expected this code to output an int of 3, but for some unknown reason it outputs an int of 0.
I would thank you all if you can explain the problem with this code.
has to the the first segment so this will work,
var_dump(strspn('237 monkeys are in the house', '1234567890'));
or use the start position parameter
var_dump(strspn("There are 237 monkeys in the house", "1234567890",10));
dagon;10924788 wrote:has to the the first segment so this will work, var_dump(strspn('237 monkeys are in the house', '1234567890')); or use the start position parameter var_dump(strspn("There are 237 monkeys in the house", "1234567890",10));
Thanks so much. I guess this is the most useless function in PHP...