php: shortcut to writing this?
- by YuriKolovsky
what would be the shortest way to write this?
if(strpos($haystack, $needle)!==false){
$len = strpos($haystack, $needle)+strlen($needle);
}else{
$len = 0;
}
I remember that I saw some shortcut somewhere for this that checked and set a variable at the same time.