Possible Duplicate:
PHP: How to check if a string starts with a specified string?
I am struggling to create a function to check this string starting from start_to_date or not, below is my implement.
$string = 'start_to_date-blablablabla';
if(cek_my_str($string)){
echo "String is OK";
}
// tes again
$string2 = 'helloworld-blablablabla';
if(cek_my_str($string2)){
echo "String not OK";
}
function cek_my_str($str){
// how code to return true if $str is string which start with start_to_date
}
Thanx.