Re: PECL JSON package

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Eric Butera wrote:
On Thu, Dec 11, 2008 at 5:43 AM, Phil Ewington - iModel
<phil.ewington@xxxxxxxxxxxxx> 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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux