Tag Archives: code

PHP Script to Trim and Replace Apostrophes for Each Value in Each Column of Each Table in a MySQL Database

I needed to quickly whip up a script that would strip all leading and trailing whitespace plus replace any apostrophes or quotation marks with their web code equivalent for each and every value that appeared in every row, column and table in the database. Continue reading

Posted in Technology & Code, Tutorials | Tagged , , , , , , , , , | View Comments

jQuery: How to Expand an Accordion for Printing

I did however come across a little problem that needed solving the other day, namely that when printing an accordion page, only the currently open, in other words visible, accordion segment prints, leaving the rest of the closed segments hidden on the final printed page. Continue reading

Posted in Technology & Code, Tutorials | Tagged accordion, , expand, , , print, ui | View Comments

PHP: Calculate the Number of Working Days in a Month

How to calculate the number of working days in a month, in other words discount Saturdays and Sundays from a month’s total number of days. Continue reading

Posted in Technology & Code, Tutorials | Tagged calculate, calculation, , days in month, number of days, , working days | View Comments

PHP: Select Random Web Color with One Line of Code

The quickfire tip for today is the generation of a random HTML color using just a single line of PHP color. Handy if you want to throw a bit of a surprise burst of changing color here and there… Continue reading

Posted in Technology & Code, Tutorials | Tagged , , , , , , | View Comments