Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

String_Begins_With

DZone's Guide to

String_Begins_With

·
Free Resource
No more letter counting... :-)
edit: see kirk's faster solution "String_Begins_With2"


function String_Begins_With($needle, $subject) {
 return (substr($subject, 0, strlen($needle))==$needle);
}
Topics:

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}