Profile
Achievement
iridium's Recent PHP Snippets
- All /
« Prev 1 Next »
Generates an options list of years for a select box, going from current year backwards through the number of years specified in the first variable.
Useful for birthday fields on signup forms.
eg. 2009, 2008, 2007, 2006 ... 1912, 1911, 1910, 190...
3
876
posted 14 years ago by iridium
Return just the Apache version number of your server, and operating system, from $_SERVER['SERVER_SOFTWARE']
Example:
print ('Apache Version: ' . apacheversion());
will return something along the lines of...
"Apache Version: 2.2.10 (Unix...
1
1489
posted 15 years ago by iridium
Simple but useful function for getting a single piece of data from a database and placing it straight into a variable.
Example:
$variable = one_result("SELECT columnOne FROM table WHERE columnTwo=whatever");
This would insert the value of colu...
1
462
posted 15 years ago by iridium