strcasecmp Does not work as expected

0
$reescreva = $lines5[array_rand($lines5)];

if(isset($_POST["reescreva"])) {
  $confere = $_POST['reescreva'];
    $textoanterior = $_POST['textoanterior'];

    echo "Texto Anterior: ". $textoanterior;
    echo "<br>Texto Digitado: " . $confere;

$verificador = strcasecmp($confere, $textoanterior);
echo "<br>" . $verificador;

if ( $verificador = 0 ) {

   echo "<br>Deu certo"; }

      else { echo "<br>OPS!";}
...... ?>

Even typing exactly the same thing strcasecmp returns -2, -80, -20, never 0. The form I am using is basically this:

    <form action=""  method="post" >
    Texto Digitado: <input type="text" name="reescreva"  title="OPS !" >
      <input type="hidden" name="textoanterior" value="<?php echo $reescreva ?>">
      <input type="submit">
      </form>

What is wrong? Visually, the values of the texts are identical!

    
asked by anonymous 27.01.2018 / 19:00

0 answers