PHP

From Lankyland

Jump to: navigation, search

PHP

Contents

Versions

Currently developing in PHP 5.2, have used PHP 4 previously.

Basic PHP Formating

All PHP needs to be within the PHP tags. <?php and ?> (<? are discouraged often)

Statements end with a ;

Functions

These functions are ones that I have found very useful. They include functions that come with PHP and also functions that have been written by developers. I will try to attribute the original authors when I can however I have been using some of these functions for so long I have lost the original author's details.

Inbuilt Functions

Custom PHP Functions

  • daysBetweenDates() - calculates the number of days between two dates
  • prettySize() - takes a file size in bytes and returns it in an easier to read format
  • parse_urls() - parses a string and takes any URLs and turns them into hyperlinks
  • Geotargeting - determining a users location based on IP Address
  • printTime() - show what time it is in multiple locations
Personal tools
Donate
Donate towards my web hosting bill!