Jump to content
php.lv forumi

Problēma ar PHP time kodu


hai2ukri
 Share

Recommended Posts

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ā?

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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...
 Share

×
×
  • Create New...