String_Begins_With2
edit: strncmp is faster...
1 2 function String_Begins_With($needle, $subject) { 3 return (strncmp($subject, $needle, strlen($needle))==0); 4 }
DZone Snippets > kirk > php
12973 users tagging and storing useful source code snippets
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
1 2 function String_Begins_With($needle, $subject) { 3 return (strncmp($subject, $needle, strlen($needle))==0); 4 }