Skip to content

Instantly share code, notes, and snippets.

@chazmead
chazmead / 2Dimension Array Sort
Last active August 29, 2015 13:56
/** * Sort a 2 dimension array with values in the second dimension * * Order can be string of a field, which will default to asc * OR as array(field1,field2...fieldn) each defaulting to asc * OR as assoc array(field1 => dir[asc|desc], field2 => dir[asc|desc]...fieldn * => dir[asc|desc]) * * PHP Sort constants can be used: SORT_ASC | SORT_DESC * *
<?php
/**
* Sort a 2 dimension array with values in the second dimension
*
* Developer: chazmead89@gmail.com // @RaggaMuffin-4201
*
* Order can be string of a field, which will default to asc
* OR as array(field1,field2...fieldn) each defaulting to asc
* OR as assoc array(field1 => dir[asc|desc], field2 => dir[asc|desc]...fieldn
* => dir[asc|desc])
@chazmead
chazmead / EmailValidation.php
Last active May 3, 2022 09:06
Email Validation the correct way!
<?php
/**
* Email Validation
*
* @access public
* @param string
* @return bool
*
* FUNCTION BY CHAZMEAD89 @ GMAIL.COM
*
@chazmead
chazmead / SessionModel.php
Last active December 28, 2015 07:38
/** Session model - To make session implementations in OOP alot smoother and * user friendly. * But also utilises optimised session closing / opening to allow asynchronous * session access which is a major pitfall of PHP currently. * * Implementing this script will only lock to session while its being written * to, and very quickly on constructo…
<?php
/**
* Session model - To make session implementations in OOP alot smoother and
* user friendly.
* But also utilises optimised session closing / opening to allow asynchronous
* session access which is a major pitfall of PHP currently.
*
* Implementing this script will only lock to session while its being written
* to, and very quickly on constructor to read from, after that its open for