PHP strcspn() May 22, 2012 Pramod T P It returns the number of characters found in a string before any part of the specified characters are found. Example <?php echo strcspn(“phpcode”,”c”); ?> Output 3