PHP COVID-19 Coronavirus Data via JSON

Want to add Coronavirus data to your website? It’s simple with PHP and JSON. There are numerous resources available to pull data from. For this example I will utilize the COVID Tracking Project API. API Data Visit the COVID Tracking Projects API page and find your State from the “States …

PHP Form Select with Date Range

Create a form select with a range of years automatically with PHP. [php] &lt;select&gt; &lt;?php foreach(range(2008, (int)date("Y")) as $year) { echo "\t&lt;option value=’".$year."’&gt;".$year."&lt;/option&gt;\n"; } ?&gt; &lt;/select&gt; [/php] The above code will output the following: <select> <option value=’2008′>2008</option> <option value=’2009′>2009</option> <option value=’2010′>2010</option> <option value=’2011′>2011</option> <option value=’2012′>2012</option> <option value=’2013′>2013</option> <option value=’2014′>2014</option> <option …

Awesome Visual Crontab Editor

I don’t regularly create cronjobs; however when I do I can never remember the proper crontab syntax. Each time I want to edit my crontab I have to fire up my codebox for reference. For some reason its the minutes and hours that screw me every time. The trusty old …

Automatically Update Your Copyright Notice Date

Every year some lonely web folks are wasting time updating the copyright dates on their various websites footers. Since we have jumped head first into 2012 lets start the year off right. The following will show you how to use PHP to automatically update your notice. Display Current Year [php] …

Business Days To/Fro with PHP

The below example will help you with finding or setting a date to and/or fro using business days only. I needed this for a project I was working on and thought I would share. [php] <?php function dateFromBusinessDays($days, $dateTime=null) { $dateTime = is_null($dateTime) ? time() : $dateTime; $_day = 0; …

Super Simple Page Cache with PHP

Here is a super simple way serve up a cached version of your HTML. [php] <?php // define the path and name of cached file $cachefile = ‘cached-files/’.date(‘M-d-Y’).’.php’; // define how long we want to keep the file in seconds. I set mine to 5 hours. $cachetime = 18000; // …

PHP Snippets – The Name Says it All

I’ve been following a new website via Twitter. PHP Snippets (www.phpsnippets.info) posts frequent useful PHP code samples. PHP Snippets is maintained by Jean-Baptiste Jung, author of Cats Who Code and WPRecipes. PHP Snippets is a great place to find clean code samples to get you started on your project. I …

Dropbox Tips & Tricks – My Top 5

I love Dropbox; it’s simply amazing and über helpful. Appstorm has published several posts with some really useful Dropbox tips. Below are the five tips and ticks I can’t live without. Tips & Tricks If you’re not familiar with Dropbox, let me first start out by saying you’ve been missing …

Happy Birthday PHP

Happy 15th Birthday to the awesome PHP. Back in 1995, Rasmus Lerdorf issued the first public release of PHP. What is PHP? PHP is a widely-used general-purpose scripting language that is especially suited for Web development and can be embedded into HTML. Now you know! PHP Website – http://php.net Related …

How to Easily Monitor Your web Server Using PHP

In order to make sure that your website is always available to the public, you have to monitor it. In this tutorial, I’ll show you how you can easily create a monitoring script that will check your website availability and send an email or sms alert to you if it …

PHP hide_email()

A PHP function to protect the E-mail address you publish on your website against bots or spiders that index or harvest E-mail addresses for sending you spam. It uses a substitution cipher with a different key for every page load. via PHP hide_email().