Blog Archives

PHP resources go here

WordPress – fixing wp_options array

You may have noticed that when transferring between your development and production environments, your finely-crafted WordPress site will completely break. The fact that the url for the site has changed forces you to run a good old find-and-replace on the

Posted in PHP Tagged with: ,

Laravel vs. AngularJS

I have been spending some time keeping my PHP skills sharp, and have been dabbling with rewriting/updating a front end for my personal home-hosted websites. I started off with Laravel, and was pleasantly surprised with how quick and easy it

Posted in JavaScript, PHP Tagged with: , ,

Display your Twitter feed from a website

I have put up several posts on how to display recent Tweets in a webpage with PHP. However, Twitter has switched to it’s API v1.1 from today, so all of my previous articles have become obsolete. The easiest thing to

Posted in HTML/CSS, PHP

Identify a (web) link in a string with PHP

If you want to process some text and output the same text with HTML links automatically created for you, then look no further: $newstring = preg_replace(‘!(http|ftp|scp)(s)?://[a-zA-Z0-9.?&_/]+!’, “<a href=”\” target=’_blank’></a>”,$sting);

Posted in PHP Tagged with:

Displaying your latest Tweet in PHP – updated

Back in 2011 I posted a method for displaying your latest tweet in php. However times change, and the twitter API has been changed beyond all recognition. I have updated my script to interpret the JSON response from the latest

Posted in PHP Tagged with: , ,

More mobile browser detection testing

My standard method of mobile browser detection as detailed in my previous post here involves the PHP function preg_match(). Unfortunately for me, having compiled a stripped down version PHP to run on ARM linux, the preg_match() function was not included (probably

Posted in General, PHP

Using PHP to calculate a simple checksum

There is a very specific set of rules for sending a message in most protocols, and the checksum is sent at the end of a message to make sure no corruption has occurred in transmission. In the instance of sending a

Posted in PHP Tagged with: , ,

Sending data to a specific port using PHP

I have made a bit of a breakthrough on my back-burner project at work, last mentioned here on 2010 in a post on SQLite connections. As mentioned in that post there is a door control application that runs on a

Posted in PHP Tagged with: ,

PHP/MySQL dates

I have posted before as to a MySQL date, i.e. Y-m-d can be converted in a previous post here. I found myself this evening in need of converting UK dates back into the MySQL format. Now, the strtotime() function requires

Posted in PHP, SQL Tagged with: , , ,

Display your latest Tweet in PHP

So on my mobile site (http://cyte.co.uk/mobile) I created a button to link to my Twitter and this very blog you are reading. This got me thinking what I could do to keep the content fresh without much effort. As the

Posted in PHP Tagged with: ,