Mon Jan 07, 2013 3:25 pm
<?php
// check if string starts with a specific sub-string
function startsWith($myString, $needle)
{
return !strncmp($myString, $needle, strlen($needle));
}
$mystr="Bombo anas";
if(startsWith($mystr,"B")==1)
echo "String starts with B";
else
echo "String doesn't start with B";
?>
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com
Powered by phpBB © phpBB Group.