Skip to content

Instantly share code, notes, and snippets.

##### DEBIAN ################
# Debian Experimental
# deb http://ftp.de.debian.org/debian experimental main contrib non-free
# deb-src http://ftp.de.debian.org/debian experimental main contrib
# Debian Sid # CURRENT UNSTABLE
# deb http://ftp.de.debian.org/debian sid main contrib non-free
# deb-src http://ftp.de.debian.org/debian sid main contrib non-free
# Debian 8.0 (Jessie) # CURRENT TESTING
@kriswema
kriswema / gist:3736151
Created September 17, 2012 08:21
Format JSON if PHP version is newer or equal to 5.4.0
// If JSON_PRETTY_PRINT is supported by json_encode(), use it.
if(strnatcmp(phpversion(),'5.4.0') >= 0)
{
echo json_encode($realoutput, JSON_PRETTY_PRINT);
}
else
{
echo json_encode($realoutput);
}