samedi 30 mai 2020

How to fix PHP 7.2 Warning: count(): Parameter must be an array or an object that implements Countable in errors.php?

My script is-

<?php  if (count($errors) > 0) : ?>
  <div class="error">
        <?php foreach ($errors as $error) : ?>
          <p><?php echo $error ?></p>
        <?php endforeach ?>
  </div>
<?php  endif ?>

The error I get is Warning: count(): Parameter must be an array or an object that implements Countable.

I'm using PHP 7.2 on Apache2.




Aucun commentaire:

Enregistrer un commentaire