- preg_replace: documentation ( source)
<?php
$policy = <<<STRING
{ "expiration": "2013-3-14T23:20:33.000Z", "condi\ttions": [{"bucket": "clientvids_in"}, ["starts-with", "\$key", "233326"], {"acl": "public-read"}, ["starts-with", "\$Filename", ""]]}
STRING;
echo $policy . "\n";
echo preg_replace('/\s\s+|\\f|\\n|\\r|\\t|\\v/', '', $policy);