471,066 Members | 1,582 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,066 software developers and data experts.

A non well formed numeric value encountered

274 100+
I get this error on following line in php class:
Expand|Select|Wrap|Line Numbers
  1. return date("d. F Y.", mktime (0,0,0, $arr[1], $arr[2], $arr[0]));
It is inside a function:
Expand|Select|Wrap|Line Numbers
  1. function formatDate($val) {
  2.         $arr = explode("-", $val);
  3.         print_r($arr[2]); 
  4.         return date("d. F Y.", mktime (0,0,0, $arr[1], $arr[2], $arr[0]));
  5.     }
can someone help me fix this error.

This function is called by another funtion like this
Expand|Select|Wrap|Line Numbers
  1. while ($row = mysql_fetch_object($sql)) {
  2.                 $datum = $this->formatDate($row->timestamp);
  3.                 echo "<a href=\"$this->results_page?pollid=$row->pollid\">$row->polltitle</a> $datum<br />\r\n";
  4.             }
can someone help me fix this error.
EDIT:
This wat I get is array when I try to print it:
Expand|Select|Wrap|Line Numbers
  1. Array ( [0] => 2008 [1] => 08 [2] => 02 15:37:59 ) 
Aug 5 '08 #1
1 4065
creative1
274 100+
It works fine if I do not call the format function and use the value without formatting
Aug 5 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by Travis Oliphant | last post: by
2 posts views Thread by James Foreman | last post: by
6 posts views Thread by M.A. Oude Kotte | last post: by
3 posts views Thread by Jerome Cohen | last post: by
2 posts views Thread by jelle | last post: by
4 posts views Thread by Armel Asselin | last post: by
2 posts views Thread by Arpan | last post: by
13 posts views Thread by nishit.gupta | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.