Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.1.2

Request #12029 Add Json string support
Submitted: 2007-09-12 03:58 UTC
From: electroteque Assigned:
Status: Open Package: HTML_Javascript (version 1.1.1)
PHP Version: 5.2.4 OS:
Roadmaps: (Not assigned)    
Subscription  


 [2007-09-12 03:58 UTC] electroteque (Daniel Rossi)
Description: ------------ Hi, I was wondering if its possible to include a function into convert to add json string support. I believe json_encode already escapes quotes, it sadly quotes keys, and a firefox bug requires brackets around the array because of this. function convertJsonString($str, $varname, $global = false) { $var = ''; if ($global) { $var = 'var '; } $var .= $varname.' = ('.$str.')'; return $var.';'.HTML_JAVASCRIPT_NL;; } Let me know

Comments