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










0
















This question already has an answer here:



  • Warning: A non-numeric value encountered

    14 answers



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










share|improve this question















marked as duplicate by Qirel, Mohammad, RiggsFolly php
Users with the  php badge can single-handedly close php questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
Nov 12 '18 at 14:06


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.










  • 1





    Ummmmm, and line #34 is where exactly?

    – MonkeyZeus
    Nov 12 '18 at 14:06











  • For future reference, it is always usful to identify the LINE with the error. Specially if its line 34 and you only show us 8 lines of code

    – RiggsFolly
    Nov 12 '18 at 14:07















0
















This question already has an answer here:



  • Warning: A non-numeric value encountered

    14 answers



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










share|improve this question















marked as duplicate by Qirel, Mohammad, RiggsFolly php
Users with the  php badge can single-handedly close php questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
Nov 12 '18 at 14:06


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.










  • 1





    Ummmmm, and line #34 is where exactly?

    – MonkeyZeus
    Nov 12 '18 at 14:06











  • For future reference, it is always usful to identify the LINE with the error. Specially if its line 34 and you only show us 8 lines of code

    – RiggsFolly
    Nov 12 '18 at 14:07













0












0








0









This question already has an answer here:



  • Warning: A non-numeric value encountered

    14 answers



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










share|improve this question

















This question already has an answer here:



  • Warning: A non-numeric value encountered

    14 answers



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





This question already has an answer here:



  • Warning: A non-numeric value encountered

    14 answers







php






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 12 '18 at 14:08









RiggsFolly

70.3k1864109




70.3k1864109










asked Nov 12 '18 at 14:04









SteffLoSteffLo

31




31




marked as duplicate by Qirel, Mohammad, RiggsFolly php
Users with the  php badge can single-handedly close php questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
Nov 12 '18 at 14:06


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.






marked as duplicate by Qirel, Mohammad, RiggsFolly php
Users with the  php badge can single-handedly close php questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
Nov 12 '18 at 14:06


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.









  • 1





    Ummmmm, and line #34 is where exactly?

    – MonkeyZeus
    Nov 12 '18 at 14:06











  • For future reference, it is always usful to identify the LINE with the error. Specially if its line 34 and you only show us 8 lines of code

    – RiggsFolly
    Nov 12 '18 at 14:07












  • 1





    Ummmmm, and line #34 is where exactly?

    – MonkeyZeus
    Nov 12 '18 at 14:06











  • For future reference, it is always usful to identify the LINE with the error. Specially if its line 34 and you only show us 8 lines of code

    – RiggsFolly
    Nov 12 '18 at 14:07







1




1





Ummmmm, and line #34 is where exactly?

– MonkeyZeus
Nov 12 '18 at 14:06





Ummmmm, and line #34 is where exactly?

– MonkeyZeus
Nov 12 '18 at 14:06













For future reference, it is always usful to identify the LINE with the error. Specially if its line 34 and you only show us 8 lines of code

– RiggsFolly
Nov 12 '18 at 14:07





For future reference, it is always usful to identify the LINE with the error. Specially if its line 34 and you only show us 8 lines of code

– RiggsFolly
Nov 12 '18 at 14:07












1 Answer
1






active

oldest

votes


















0














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






share|improve this answer





























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














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






    share|improve this answer



























      0














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






      share|improve this answer

























        0












        0








        0







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






        share|improve this answer













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







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 12 '18 at 14:06









        Brandon NelsonBrandon Nelson

        837




        837













            Popular posts from this blog

            How to how show current date and time by default on contact form 7 in WordPress without taking input from user in datetimepicker

            Syphilis

            Darth Vader #20