Skip to content

Instantly share code, notes, and snippets.

View get_daterange_timestamps.php
<?php
/**
* Generates timestamp bounderies for the passed date range name.
*
* @param string $range Date range name.
*
* @return array
*/
function get_daterange_timestamps($range)
@OzzyCzech
OzzyCzech / normalise-path.php
Created Aug 25, 2012 — forked from thsutton/normalise-path.php
Normalise paths in PHP
View normalise-path.php
<?php
/**
* Normalise a file path string so that it can be checked safely.
*
* Attempt to avoid invalid encoding bugs by transcoding the path. Then
* remove any unnecessary path components including '.', '..' and ''.
*
* @param $path string
* The path to normalise.
* @param $encoding string
You can’t perform that action at this time.