With PHP 5 they introduced the DateTime class. Prior to that everyone used strtotime, date, etc...commands to achieve the same results. I was a late adopter and continued to use…
The PHP function strtok splits a string one by one. In the example below I'm trying to split off everything after the ? in the URL. https://www.facebook.com/LiquidWebInc?fref=ts https://www.facebook.com/CocaColaUnitedStates?brand_redir=1 In PHP…
Quick example of how to use PHP's parse_str command. Here is an example of my data: $source = "access_token=CAAWhyYsjaWsBAOCwjZCs&expires=5180531"; What I'm trying to do is just grab the string of…
This is the first in what will end up being a several part tutorial on creating a Twitter posting program. These tutorials will show how to create the bot using…
A simple example of how to take a date and change it's format using PHP. August, 3 2015 to YYYY-MM-DD Easily done with the below code: $old_date = 'August 3,…
I'm trying to parse out an RSS feed for images. My original code grabbed the title, description, link, and pubDate just fine. I read a tutorial online on how to…
When passing dates from a form to be saved in your database you sometimes need to change their format. For example a with a datetimepicker you want the format to…
I had a request this morning on how to create a short code in Wordpress that would list out all of the post titles and dates separated by month. Similar…
While SSH'd into my Centos server recently, I kept getting strange errors when trying to run PHP Artisan and Composer commands. I couldn't figure out for the life of me…