Eric Butera wrote:
On Thu, Dec 11, 2008 at 5:43 AM, Phil Ewington - iModel
<phil.ewing...@i-model.co.uk> wrote:
Phil Ewington - iModel wrote:
Hi All,

I have just installed the PECL JSON package, or at least think I have!!
But how do I use it?? I was expecting /usr/share/pear/Services/JSON.php to
be found on my system for include but not so. My system tells me I have
1.2.1 successfully installed but I cannot find any docs that tell me how to
make use of it. I am running PHP 5.1.6 at present.

TIA

Phil.

OK, seems I am confusing PECL and PEAR. Have now configured extension using
phpize and enabled in php.ini.

- Phil.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



If you're using the pecl version, it is json_encode().

If you're using the pear version you say
require_once 'Services/JSON.php';
$json = new Services_JSON();
$output = $json->encode($value);

If you're using php5, you should have json in the build unless it was
disabled for some reason.  If you're going to be using it a lot,
you're really going to want the speed of the c version.

Yeah thanks. I am using the PECL version and have it compiled as an extension now working fine, just got confused with installing PEAR scripts. I have PHP 5.1.6, JSON only available in build from 5.2.0 I believe.

- Phil.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to