脚本宝典收集整理的这篇文章主要介绍了解析php中的solr响应并在html表中显示它们,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
$solr_return= file_get_contents($full_request_URL);
现在响应不是一个简单的XMl格式,如果你知道我的意思,它就有了它的解决方案.我希望能够解析返回的xML并在html中的表中的行中显示它们.
我一直在网上看,有许多不同的想法让我觉得我可能完全不在,这不是这样做的方法.如果你是我,你会怎么做?
$solr_return中的xml如下所示:
<?xml version="1.0" encoding="UTF-8"?> <response> <lst name="responseHeader"> <int name="status">0</int> <int name="QTime">95</int> <lst name="params"> <str name="indent">true</str> <str name="rows">10</str> <str name="start">0</str> <str name="q">*:*</str> <str name="shards">some shards here</str> </lst> </lst> <result name="response" numFound="2403043" start="0"> <doc> <str name="1">test1</str> <str name="2">test2</str> <str name="3">test3</str> </doc> <doc> <str name="1">test1</str> <str name="2">test2</str> <str name="3">test3</str> </doc> </result> </response>
对于此示例,我想显示一个包含三列1,2和3以及两行test1,test2和test3的表.
感谢您的帮助.
以上是脚本宝典为你收集整理的解析php中的solr响应并在html表中显示它们全部内容,希望文章能够帮你解决解析php中的solr响应并在html表中显示它们所遇到的问题。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。