![ישן](https://static.fresh.co.il/images/vBulletin/statusicon/post_old.gif)
20-01-2007, 19:49
|
|
|
חבר מתאריך: 17.05.04
הודעות: 1,454
|
|
Exceptions - ההודעה לא יוצאת לפלט.
קוד PHP:
<? function validateTimestamp($timestamp){ if($timestamp){ if(gettype($timestamp) == 'string'){ if($timestamp = strtotime($timestamp)) return $timestamp; throw new Exception('Cannot translate the given string in to unix timestamp'); } elseif(gettype($timestamp) == 'integer') return $timestamp; else throw new Exception('Cannot translate the given \''.gettype($timestamp). '\' into unix timestamp'); } return time(); } try{ echo @date('Y', "asdasdasd"); } catch(Exception $e){ echo $e->getMessage(); } ?> ?>
משום מה, זה לא מוציא לפלט את השגיאה - זה אפילו לא 'תופס' את השגיאה.
אשמח לפתרון, המשך יום נעים.
עריכה: אשמח אם תעבירו אשכול זה לפורום PHP. מצטער על הטעות.
_____________________________________
EVERYTHING SHOULD BE MADE AS SIMPLE AS POSSIBLE, BUT NOT ONE BIT SIMPLER
ALBERT EINSTEIN
נערך לאחרונה ע"י Rs3k בתאריך 20-01-2007 בשעה 20:04.
|