<?php
function strposNth($texto, $procurar, $n){
switch($n){
case $n === 0:
return false;
break;
case $n === 1:
return(strpos($texto, $encontrar) + 1); break;
default:
return(strpos($texto, $procurar, strposNth
($texto, $procurar, $n - 1) + break;
}
}
echo strposNth("overflow", "o", 2);
PD9waHAKCmZ1bmN0aW9uIHN0cnBvc050aCgkdGV4dG8sICRwcm9jdXJhciwgJG4pewoJc3dpdGNoKCRuKXsKCQljYXNlICRuID09PSAwOgoJCQlyZXR1cm4gZmFsc2U7CgkJCWJyZWFrOwoJCWNhc2UgJG4gPT09IDE6CgkJCXJldHVybihzdHJwb3MoJHRleHRvLCAkZW5jb250cmFyKSArIDEpOwoJCQlicmVhazsKCQlkZWZhdWx0OgoJCQlyZXR1cm4oc3RycG9zKCR0ZXh0bywgJHByb2N1cmFyLCBzdHJwb3NOdGgoJHRleHRvLCAkcHJvY3VyYXIsICRuIC0gMSkgKwoJCQlzdHJsZW4oJHByb2N1cmFyKSkgKyAxKTsKCQkJYnJlYWs7Cgl9Cn0KCmVjaG8gc3RycG9zTnRoKCJvdmVyZmxvdyIsICJvIiwgMik7CgoK