Warning: A non-numeric value encountered in /templates/section-home.php on Line 34 [duplicate]
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
php
marked as duplicate by Qirel, Mohammad, RiggsFolly
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 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.
add a comment |
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
php
marked as duplicate by Qirel, Mohammad, RiggsFolly
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 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 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 at 14:07
add a comment |
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
php
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
php
edited Nov 12 at 14:08
RiggsFolly
69.7k1864109
69.7k1864109
asked Nov 12 at 14:04
SteffLo
31
31
marked as duplicate by Qirel, Mohammad, RiggsFolly
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 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
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 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 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 at 14:07
add a comment |
1
Ummmmm, and line #34 is where exactly?
– MonkeyZeus
Nov 12 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 at 14:07
1
1
Ummmmm, and line #34 is where exactly?
– MonkeyZeus
Nov 12 at 14:06
Ummmmm, and line #34 is where exactly?
– MonkeyZeus
Nov 12 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 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 at 14:07
add a comment |
1 Answer
1
active
oldest
votes
try to initialize your $slideCount and $slideNumber variables as 0 instead of ""
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
try to initialize your $slideCount and $slideNumber variables as 0 instead of ""
add a comment |
try to initialize your $slideCount and $slideNumber variables as 0 instead of ""
add a comment |
try to initialize your $slideCount and $slideNumber variables as 0 instead of ""
try to initialize your $slideCount and $slideNumber variables as 0 instead of ""
answered Nov 12 at 14:06
Brandon Nelson
837
837
add a comment |
add a comment |
1
Ummmmm, and line #34 is where exactly?
– MonkeyZeus
Nov 12 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 at 14:07