Twitsnip is a place to post code snippets and share them. Login with your existing Twitter account, if you don't have a Twitter account simply create on at www.twitter.com

Category: php

Twitter style time stamp

0

This function takes the date and time and returns how much time has passed, just like twitter does. for example 10 seconds ago

using nl2br

0

Example of how to use nl2br

process forms of any size

0

process forms of any size

OOP FTP Class in PHP

0

A basic OOP FTP class

Change a variable to

0

This simple function checks the name of a variable and if it is a certain value changes it, else it will return the original value.

Export PHP to EXCEL

1

Export php to excel simply.

Calculating the Moon Phase

0

This function allows you to calculating the Moon Phase with php.

PHP function to check lenght of string

0

This was the first function I ever wrote and I still use it in nearly every PHP application I create.

PHP function to genarate a random password

0

I use this in case someone has forgotten there password alongside some other code. Hope it is useful!

Using PHP To Return Latitude And Longitude from address

1

Been using this useful script to get Latitude And Longitude from there address. Work with first 3 letters of postcode only for some reason.

Function to delete folders from a Server

0

Easily delete a folder and all sub folders from a server using a PHP function

snippet to delete a row from a mysql database

0

Short snippet to delete a row from a database table

Date format for mysql input

0

Snippet to re-order date vars to put them in the correct format for mysql entry.

Function to clean POST variables

0

This functions allows you to filter any post data ready for insertion into MySQL

Login checker Functions

0

2 login functions that check if a user is logged in by checking is a session is equal to true that would have been set on login. If not logged in the redirect to login.php

Login function

0

These functions will login a user based on a username and password being matched in a mysql database.

Update Multiple rows in a single form

0

This snippet will show you how to update multiple rows of a MySQL database table using a single form.

Redirect Function

0

A function to redirect based on a string.