Articles tagged with: PHP

How to write PHP with CSS Syntax

on Tuesday, 02 August 2011.

I've recently designed a template system, and wanted to make it as easy as possible for the designers to enter values into PHP functions. So I wrote a little function to allow a CSS style string to be converted into an array.

PHP Microtime Function

on Monday, 09 May 2011.

The PHP microtime() function returns the current Unix timestamp in microseconds.

microtime() returns a string and alternatively microtime(true) returns a float.

Flexible Random String Generator with PHP

on Wednesday, 06 April 2011.

This is a short  and relatively simple tutorial with some useful php functions to generate unique random alphanumeric codes. These can be useful for generating url codes, like the ones featured in bit.ly, tinyurl, youtube etc.

These php functions allow you to create as many codes as you like with the characters you chose. It also lets you add in your existing codes so that you don't get duplicates.

Yootheme Zoo - Accessing Element Data with Joomla Code

on Wednesday, 23 March 2011.

If you're looking to write some custom code with yootheme's zoo then you'll probably be wondering how to access all the data in those dynamic fields you created through their lovely admin user interface. If you look in the jos_zoo_item table in your database you'll see a column called elements. If you look at the contents you'll see that majority of your zoo items data is stored in there as XML.

Dynamic PHP Copyright Date Code

on Thursday, 24 February 2011.

Pretty simple but pretty handy too! Here's a short tutorial to generate the current year in your footer's copyright declaration. It also detects if the the site has been running for less than a year to avoid the date printing out like this © 2011-2011 rather than just this © 2011.

Example: Your Company Name © 2010-2011 All Rights Reserved.

Joomla - Custom Page Title

on Sunday, 12 December 2010.

In the past I've used a joomla plugin called Title Manager. However I've noticed that it isn't as flexible as it should be.

So I've come up with some code that gives you the ability to name your front page title & append your desired description to all other titles. This is essential for SEO.