Re: Displaying a date with strtotime
From: Pedro Graca (hexkid_at_hotpop.com)
Date: 01/07/04
- Next message: CountScubula: "Re: A tool to execute PHP scripts"
- Previous message: Agelmar: "Re: PHP-guru estimation??"
- In reply to: Paul Beckett: "Displaying a date with strtotime"
- Next in thread: Tim Van Wassenhove: "Re: Displaying a date with strtotime"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 7 Jan 2004 20:32:56 GMT
Paul Beckett wrote:
> However, in another part of the webpage, I have to insert another date that
> may contain a NULL entry in the database. If I use strtotime to format this
> then it enters the current date, whereas I want it left blank.
<?php
$x=''; // with $x='2004-01-07'; works as expected
if ($x) echo date('Y-m-d', strtotime($x));
else echo 'NULL';
?>
--
--= my mail box only accepts =--
--= Content-Type: text/plain =--
--= Size below 10001 bytes =--
- Next message: CountScubula: "Re: A tool to execute PHP scripts"
- Previous message: Agelmar: "Re: PHP-guru estimation??"
- In reply to: Paul Beckett: "Displaying a date with strtotime"
- Next in thread: Tim Van Wassenhove: "Re: Displaying a date with strtotime"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|