Over the years I’ve accumulated a few useful tidbits that I thought would be helpful. These aren’t relevant to authors, but since people regularly let me know they’ve found them helpful, I’m keeping them online.
- PHP Function for a List of States for HTML Forms — This is a useful function for keeping code clean, you can just stick this function into an external file.
- MySQL List of States & PHP Function for Select Box — Similar to the above, but utilizes a MySQL table.
- Mini-Framework Functions — Sometimes using a framework is just overkill! A framework can be hard on a server’s resources and most sites don’t use all the features of any given framework. They also take time to learn—and who’s got time to do that when the project is due tomorrow morning? Following are some simple framework-like mini functions that will help keep your code clean and consistent and move things along a little faster.
- How to get a file’s extension from the filename
- MySQL Table of all Countries and the Spanish extension for the script
- How to Deal with Apostrophes/Single Quotes in PHP when using preg_match
- HTML & XHTML Document Frameworks – Not strictly PHP/MySQL-related, but helpful
- How to Display MySQL Dates in Other Formats using PHP
- How to Get the Last Auto-Incremented Number From MySQL