includes/functions.php
changeset 519 94214ec0871c
parent 507 586fd7d3202d
child 533 698a8f04957c
equal deleted inserted replaced
518:2b826f2640e9 519:94214ec0871c
  4076   
  4076   
  4077   return $json;
  4077   return $json;
  4078 }
  4078 }
  4079 
  4079 
  4080 /**
  4080 /**
       
  4081  * Trims a snippet of text to the first and last curly braces. Useful for JSON.
       
  4082  * @param string Text to trim
       
  4083  * @return string
       
  4084  */
       
  4085 
       
  4086 function enano_trim_json($json)
       
  4087 {
       
  4088   return preg_replace('/^([^{]+)\{/', '{', preg_replace('/\}([^}]+)$/', '}', $json));
       
  4089 }
       
  4090 
       
  4091 /**
  4081  * Starts the profiler.
  4092  * Starts the profiler.
  4082  */
  4093  */
  4083 
  4094 
  4084 function profiler_start()
  4095 function profiler_start()
  4085 {
  4096 {