Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.
Example 1:
Input: haystack = "hello", needle = "ll" Output: 2
Example 2:
Input: haystack = "aaaaa", needle = "bba" Output: -1
function strStr($haystack, $needle) {
if(($haystack==$needle)||($needle=="")){
$re=0;
}else{
$re= strpos($haystack,$needle);
if(empty($re)){
if($re!==0){
$re= "-1" ;
}else{
$re=0;
}
}else{
$re= $re ;
}
}
return $re;
}