I have a database that stores the dates various public officials held office. The dates fall into three categories:
$TermB - the year their term began
$TermE - the year their term ended
$TermM - any particular year they happened to occupy office; I display this if I lack more detailed information
Ideally, I want to display this:
1978-1982
But if I have just the beginning date, my display looks like this:
1978-
If I only had the ending date, it would look like this:
-1982
And if I don't know when their term began or ended, but I do know that they held office in 1980, I might display something like this:
?-1980-?
The script below handles situations where I have both a beginning and ending date, a beginning date only or neither a beginning or ending date. How can I modify it so that it also handles situations where I have an ending date only?
In other words, how can I change it so the first line says "If either $TermB OR $TermE is not empty...?
Thanks.
PHP Code:if($TermB -- !'')
{ $Term = ''.$TermB.'-'.$TermE.''; }
else
{ $Term = $TermM; }





Bookmarks