Help! "A non well formed numeric value encountered.."

Hi,

My errorlog keep spamming the following errormsg:

“PHP Notice: A non well formed numeric value encountered on line 365”.

This is the code it refers to:

for ($yr = $year, $age = -1; mktime(0, 0, 0, $month, $day, (int)$yr) < $today; $yr++, $age++);

It’s supposed to calculate the owner of the page’s age. The full code is:

list($year,$month,$day) = explode("-", $birthday);
				$tempVar=list($year,$month,$day) = explode("-", $birthday);
				$today = time();
				for ($yr = $year, $age = -1; mktime(0, 0, 0, $month, $day, (int)$yr) < $today; $yr++, $age++);

Hi there,

Have you tried just using $yr in the for loop rather than (int)$yr ?

Hi,

thanks for your reply :slight_smile:

Yes I’ve removed the (int)…still getting spammed with the same error though :frowning:

From what I know all the variables after mktime must be ints…from what I see they all should be int’s…so I’m rather baffled :frowning:

Sponsor our Newsletter | Privacy Policy | Terms of Service