Forum Moderators: coopster

Message Too Old, No Replies

Error Help : A non well formed numeric value encountered

A non well formed numeric value encountered php error

         

xKillswitchx

3:47 am on Sep 2, 2007 (gmt 0)

10+ Year Member



Hopefully I can find some help here. I am getting this error thrown at me ...

Notice: A non well formed numeric value encountered in functions.php on line 15

Here is the function it is refering to...

function formatDate($val)
{
$arr = explode('-', $val);
return date('M d, Y', mktime(0,0,0, $arr[1], $arr[2], $arr[0]));
}

The function simply alters the timestamp value retreived from the database and makes it much more legible. I dont know what this error even means, any help with this?

cameraman

7:41 am on Sep 2, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you put
print_r($arr);

between the two lines, you'll probably see why it's unhappy.

Little_G

10:57 am on Sep 2, 2007 (gmt 0)

10+ Year Member



Hi,

Also, take a look at strtotime [php.net], it should make parsing the timestamp easier.

Andrew