URL checking by % correct words

Asked

Viewed 67 times

1

I do a check:

if( $nomedoaluno <> str_replace(" ","-",semacentos($arrayReturn['nomedoaluno'])) ){
exit();

and assemble the url www.foo.com/student-name

I would like to do a check so that: "If 80% is correct" does not terminate the program.

It is possible?

I thought I’d separate every word and check:

$array=explode("-",$nomealuno); 

But I don’t know what the code would look like. Someone can help me?

Got that way:

$aluno1 = $nomedoaluno;
$aluno2 = str_replace(" ","-",semacentos($arrayReturn['nomedoaluno']));
if($porcentagem < 80){
exit();
}

1 answer

3


You may be testing this similar_text(), see if it solves the problem :

<?php    
    $texto1 = 'Teste com Variavel';
    $texto2 = 'Teste com Var PHP';
    $iguais = similar_text($texto1, $texto2, $porcentagem);

    echo "As duas strings tem $iguais caracteres iguais, com $porcentagem% de igualdade.";
    if($porcentagem >= 80){
        print("Atende a URL");
    }
    else{
        print("Não atende a URL");
    }
?>
  • Thanks @Gabriel~ ! added in my question how I applied on my system.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.