Jump to content
php.lv forumi

Recommended Posts

Posted

Kods:

 

echo '<tr><td>'.$arr['id'].'</td><td>'.$arr['username'].'</td><td>'.date("d-M-Y H:i",$arr['expire']).'</td></tr>';

 

Viss strādā ok, tika izvada nepatīkumu notice - Notice: A non well formed numeric value encountered

 

 

Ko varētu darīt lietas labā?

Posted

ko rāda

echo '<tr><td>'.$arr['id'].'</td><td>'.$arr['username'].'</td><td>'.$arr['expire'].'</td></tr>';

ja timestampu, tad tā notice no citas vietas lec.

Posted

Tevis dotais kods izvada pašu timestampu - 1281376800, taču notice pazūd. Iekopējot atpakaļ veco kodu, notice atkal parādās.

 

Noticē norādīts, ka kļūda 238 rindiņā, tā ir tieši tā, kuru norādīju pirmajā postā.

Posted (edited)

pamēģini

echo '<tr><td>'.$arr['id'].'</td><td>'.$arr['username'].'</td><td>'.(is_numeric($arr['expire']) ? date("d-M-Y H:i",$arr['expire']) : '---').'</td></tr>';

un vēl protams vienmēr visu var noslēpt, bet tas nav labākais variants, vienmēr visu jāizlabo

echo '<tr><td>'.$arr['id'].'</td><td>'.$arr['username'].'</td><td>'.@date("d-M-Y H:i",$arr['expire']).'</td></tr>';

Edited by EdgarsA
Posted

echo '<tr><td>'.$arr['id'].'</td><td>'.$arr['username'].'</td><td>'.(is_numeric($arr['expire']) ? date("d-M-Y H:i",$arr['expire']) : '---').'</td></tr>';

 

Ar šo notice pazūd, taču tur kur būtu jāizvada kāds 2010. gada datums un laiks, tiek izvadītas divas domuzīmes ( -- ). Ar 2009. gadu viss OK.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...