Skip to content

Instantly share code, notes, and snippets.

@SocalNick
SocalNick / parser.php
Created March 27, 2012 16:35 — forked from jtai/parser.php
Nick's Cache-Control header parser
<?php
function parse($string)
{
$string = trim($string);
$directives = array();
// handle empty string early so we don't need a separate start state
if ($string == '') {
return $directives;