When you export JSON form PHPwhich contains data from an “unclean” data source you must enforce UTF-8 upon the data that will be added into your JSON structure.  Below I’ll show an example of exporting JSON and enforcing UTF-8 upon each record data entity.

 … Read More


Sometimes you need to export a collection of data for use to another system.  One of the easiest ways is to export it to XML as it is widely accepted as a data exchange format and standard.  PHP makes creating and exporting to XML very easy.  Below I’ll show you an example where I am exporting… Read More


I had to process a lot of Word .docx files into readable content for use in a searchable database.  Docx files are basically xml files in a zipfile container (as described by wikipedia).  Here is my solution, it’s pretty straight forward.  Just pass in the server file path to the read_docx() function and it will… Read More


Validating Email Addresses is one of the more elusive patterns to define, but this pattern will match 99.99% of all email addresses in actual use today.

A further change you could make is to allow any two-letter country code top level domain and only specific generic top level domains. This regex filters dummy email addresses… Read More


I develop a lot of data parsers and continuously run into composite mailing addresses that require to be split into their meta collections. The following Regex pattern will reformat these two style addresses into XML tag elements. SAMPLE ADDRESS DATA: 1200 Ocean Rd., Narragansett, RI 02882 1200 Ocean Rd., Narragansett, RI 02882-1234 FIND PATTERN USING… Read More


Responsive videos seem to be an after-thought for many websites. While text and images are easy to resize to mobile and tablet screens, videos have always required extra work. Even popular video sharing sites like Youtube.com still don’t have an easy “responsive” option and require specifying a video dimension for embedding. Luckily, the 3.2+ version… Read More


Having worked with CodeIgnighter for many years, I’ve crafted the following the following HTACCESS script to meet most CI needs.

 … Read More


The way to execute PHP on a .html page is to modify your .htaccess file. This file may be hidden, so depending upon your FTP program you may have to modify some settings to see it. Then you just need to add this line for .html:

Or for .htm

If you only plan… Read More


We can not present that code formatting is unimportant, but must understand why it matters.  A good code format is not the one you think looks the prettiest.  We do not do not layout code in order to exercise our deep artistic leanings.  Good code is clear.  It is consistent.  The layout is almost invisible.… Read More