0

I have changed my php version from 5.6 to 7.2.

Warning: A non-numeric value encountered in /templates/section-home.php on Line 34

This is the line

 for ($j = 1; $j <= 10; $j++) { if ( px_opt('home-gallery-'.$j) ) { $slideCount+=1;  $slideNumber=$j;} }

In this code

    <?php
            $slideCount = "";
            $slideNumber= "";
            if ( px_opt('home-type-switch') == 'home-slider' ) {
              for ($j = 1; $j <= 10; $j++) { if ( px_opt('home-gallery-'.$j) ) { $slideCount+=1;  $slideNumber=$j;} }
                if ( $slideCount > 1 ) { ?>

What do I have to change? Thank you

RiggsFolly
  • 93,638
  • 21
  • 103
  • 149
SteffLo
  • 3
  • 1

1 Answers1

0

try to initialize your $slideCount and $slideNumber variables as 0 instead of ""