Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 3B9AF64FD69 for ; Fri, 21 Nov 2008 03:18:09 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 59766-06 for ; Fri, 21 Nov 2008 03:18:06 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.238]) by mail.postgresql.org (Postfix) with ESMTP id 590AC64FD5E for ; Fri, 21 Nov 2008 03:18:06 -0400 (AST) Received: by rv-out-0506.google.com with SMTP id b25so791061rvf.43 for ; Thu, 20 Nov 2008 23:18:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=q349TKjhPhGgvlYlAShZZQ8zPanQwWq92c7gD5RIr8g=; b=wOpQ+UWyAudwCcfnVICko1qDCYo6alrkUeY/B9deqJ968oIXMX1rjntiradioZ4uEd B/YkwzU50cV5HLXaJe1El2tWQgVurMi3aoHxCtATwyDzC/uLTuMTRTOZ7JZFwTbDSKEa o7nW08fkBFo6ovoXjXor1BAlu+fz4KzfrC9ac= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=cgcRibhXFbh+OriQPY8Aey67SSDF7E0IPTduvoPrclbV3bKK1+scWykK/xvdoO7PvX aneCre3XYHub4sHYpMY9g0FuzMaKg0nZazS6NwXweNttRbZ4PjdKGxFBmxSTdLDE4qe3 h+uJMb44MNkVS9+Myc9IHZKkxhZAJZIWB6NHo= Received: by 10.140.136.6 with SMTP id j6mr137969rvd.126.1227251884998; Thu, 20 Nov 2008 23:18:04 -0800 (PST) Received: from ?192.168.0.70? (office.squiz.net [203.206.128.174]) by mx.google.com with ESMTPS id g22sm2618689rvb.8.2008.11.20.23.18.02 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 20 Nov 2008 23:18:03 -0800 (PST) Message-ID: <492660A7.3060008@gmail.com> Date: Fri, 21 Nov 2008 18:17:59 +1100 From: Chris User-Agent: Thunderbird 2.0.0.17 (X11/20080925) MIME-Version: 1.0 To: V S P CC: pgsql-php@postgresql.org Subject: Re: [Q] storing JSON, problem with 'escapes' References: <1227250475.15555.1285991741@webmail.messagingengine.com> In-Reply-To: <1227250475.15555.1285991741@webmail.messagingengine.com> Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200811/19 X-Sequence-Number: 3930 V S P wrote: > Hi, > I am using PHP's json_encode function on > an array of strings > that gives me back a JSON encoded string. > > Some of the elements in the string arrays have > double quotes. So PHP's json_encode correctly > escapes them (according to JSON specifications) > with \. > > For example here is a an array element > > "if( js_iop_lt(a,b) ){ VLADIKVLADIKVLADIKVLADIK("b2122") ;}" > > would get encoded in JSON as > > "if( js_iop_lt(a,b) ){ VLADIKVLADIKVLADIKVLADIK(\"b2122\") ;}" Is magic_quotes_gpc (or magic_quotes_runtime) on for the php server? Check with a phpinfo() page. If so, you'll need to "undo" that, see http://www.php.net/stripslashes (inc. the recursive function stripslashes_deep). -- Postgresql & php tutorials http://www.designmagick.com/