Paulund

PHP Category

Get The File Extension In PHP

PHP
Getting a file extensions from a PHP string is an important task on validating a file for a upload. For example if you have a file uploader which you only want to use for image uploads then you need to validate the file extension is of an image extension.

Here is a PHP function to get the extension of a string. It will explode the string on any “.” and get the last of the array.

Read More →

Get Current URL With PHP

PHP
Use the below PHP snippet to construct the current page URL.

It will find out if the URL is on a secure URL or not, gets the server name and port number if needed and the current page.
Read More →

PHP Function To Convert Hex To RGB

PHP
If you are working on a web app that does things with colours then you could find it useful to have function to convert between different colour types.

Here is a PHP snippet which allows you to convert HEX colours to RGB colours.
Read More →

Display Message To Stumbleupon Visitors In PHP

Stumbleupon is a great way of getting lots of visitors to your site. All you have to do is submit your pages to Stumbleupon and when people stumble in their chosen topic they will find your page. The more votes your pages get the more likely they are going to be seen.

If all you need is more people to vote for your pages then why not ask people to vote for your pages?

Read More →