Never have an outdated copyright date (displaying © 2007 in 2010) again. It’s super easy, and is only one line of code.
© <?php echo date(‘Y’); ?>
It seems it’s more prevalent around the turn of the calendar year, but why not cross it off your yearly list without even doing anything?
February 2, 2010 – 10:07 pm
Nothing new to you php gurus, but hope this can help somebody looking for a quick fix – great to filter user inputs in things like addresses, company names, and yes regular ole names. It utilizes PHP’s ucwords() and strtolower():
<?
$userInput1 = “MR. CAPITAL LETTERS”;
$userInput2 = “mrs. lowercase letters”;
ucwords(strtolower($userInput1)); //outputs “Mr. Capital Letters”
ucwords(strtolower($userInput2)); [...]
January 31, 2010 – 5:39 pm
I always have trouble finding this, so here it is. The if statement in the checkState() function can be replaced with anything you like to select the option by default…
<?
function checkState($state) {
if ($row['state'] == $state) {
echo ‘ selected=”selected”‘;
}
}
?>
<select name=”state” id=”state”>
<option value=”–”<? checkState(”) ?>>Select…</option>
<option value=”AL”<? checkState(‘AL’); [...]