lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James liu" <liuping.ja...@gmail.com>
Subject Re: how to use PHP AND PHPS?
Date Wed, 07 Nov 2007 07:04:23 GMT
i just decrease answer information...and u will see my result(full, not
part)

*before unserialize....*
> string(433)
> "a:2:{s:14:"responseHeader";a:3:{s:6:"status";i:0;s:5:"QTime";i:0;s:6:"params";a:7:{s:2:"fl";s:5:"Title";s:6:"indent";s:2:"on";s:5:"start";s:1:"0";s:1:"q";s:1:"2";s:2:"wt";s:4:"phps";s:4:"rows";a:2:{i:0;s:1:"2";i:1;s:2:"10";}s:7:"version";s:3:"
> 2.2";}}s:8:"response";a:3:{s:8:"numFound";i:28;s:5:"start";i:0;s:4:"docs";a:2:{i:0;a:1:{s:5:"Title";d:诺基亚N-Gage基本数据;}i:1;a:1:{s:5:"Title";d:索尼爱立信P908基本数据;}}}}"
>
> *after unserialize...*
> bool(false)
>

and i write serialize test code..

<?php
> $ar = array (
>     array('id' => 123, 'Title'=> "中文测试"),
>     array('id' => 123, 'Title'=> "中国上海"),
> );
>
> echo serialize($ar);
>
> ?>
>


and result is :

>
> a:2:{i:0;a:2:{s:2:"id";i:123;s:5:"Title";s:12:"中文测试";}i:1;a:2:{s:2:"id";i:123;s:5:"Title";s:12:"中国上海";}}
>



*php* result is:

string(369) "array( 'responseHeader'=>array( 'status'=>0, 'QTime'=>0,
'params'=>array( 'fl'=>'Title', 'indent'=>'on', 'start'=>'0', 'q'=>'2',
'wt'=>'php', 'rows'=>array('2', '10'), 'version'=>'2.2')),
'response'=>array('numFound'=>28,'start'=>0,'docs'=>array( array(
'Title'=>诺基亚N-Gage基本数据), array( 'Title'=>索尼爱立信P908基本数据))
))"

it is string, so i can't read it correctly by php.


-- 
regards
jl
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message