Get Percentage - PHP Function

Here is an incredibly short, sweet and simple php function that I use all of the time.  This function provides you with a rounded percentage, base between two numbers:

<?php
function Get_Percent($number,$total)
{
$percentage = round($number * 100 / $total).”%”;
echo $percentage;
}

// Usage
echo “The percentage of people who came to my party was “.Get_Percent(19,23);
?>

For example, if I invited 23 friends to a party and only 19 turned up, to get the percentage I would use Get_Percent(19,23). This would parse as ‘83%’ – phew, I still have the majority in the real friends stake!

String to URL – PHP Function

PHP function to convert a string into an SEO ready, browser-friendly URL. Useful for article creation in conjuction with .htaccess [...]

Generate PHP & MySQL code the easy way!

Guard against repetition and save time with this PHP and MySQL code generator. Free for both personal and commercial [...]

A Free Website - The Easy Way

There is an easy way to have your own website, and best of all, it’s for free. Featuring WordPress, the WYSIWYG [...]

Top 5 Most Important SEO Factors

The most important elements in your Search Engine Optimisation (SEO) campaign can be summed up in 5 simple [...]