changeset 519 | 94214ec0871c |
parent 507 | 586fd7d3202d |
child 533 | 698a8f04957c |
--- a/includes/functions.php Sun Apr 06 14:02:20 2008 -0400 +++ b/includes/functions.php Sun Apr 06 15:30:39 2008 -0400 @@ -4078,6 +4078,17 @@ } /** + * Trims a snippet of text to the first and last curly braces. Useful for JSON. + * @param string Text to trim + * @return string + */ + +function enano_trim_json($json) +{ + return preg_replace('/^([^{]+)\{/', '{', preg_replace('/\}([^}]+)$/', '}', $json)); +} + +/** * Starts the profiler. */