Hi All Please advise, using the below code date format but when text field is empty it should not display anything, but instead it gives any date, how can i go around with this.
To explicitly convert a value to integer, use either the (int) or (integer) casts. However, in most cases the cast is not needed, since a value will be automatically converted if an operator, function or control structure requires an integer argument. A value can also be converted to integer with the intval() function.
See also: type-juggling.
From booleans
FALSE will yield 0 (zero), and TRUE will yield 1 (one).[/QUOTE]
So, the functions are behaving exactly as they "should." You just have to perform an explicit test on the field before you assume it's meaningful data in the contexts in which you're using it!
[code=php]if ($row['field'] == "") { // don't operate on the field and/or use a default value } else { // operate on the field }[/code]