Heim  >  Artikel  >  Backend-Entwicklung  >  微信公众平台开发者 - 微信开发,xml中的php变量无法解析

微信公众平台开发者 - 微信开发,xml中的php变量无法解析

WBOY
WBOYOriginal
2016-07-06 13:54:081575Durchsuche

微信公众平台开发者 - 微信开发,xml中的php变量无法解析
这是返回给微信的一个图文消息,其中xml中的
$item_str
是动态的,所以需要变量引入,但好像里面的变量无法解析,这个问题应该怎么解决啊?

回复内容:

微信公众平台开发者 - 微信开发,xml中的php变量无法解析
这是返回给微信的一个图文消息,其中xml中的
$item_str
是动态的,所以需要变量引入,但好像里面的变量无法解析,这个问题应该怎么解决啊?

变量是可以解析的,用sprintf也可以成功,问题出在前面的变量,我传进来的东西不是数组,所以出错了,还是要多调试多检查哈

用加点的方式解决,例如:

<code><articles>" . $item_str . "</articles></code>
Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn