In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
Editor to share with you the PHP Wechat development of Wechat message automatic response to the problems encountered, I believe most people do not know much, so share this article for your reference, I hope you will learn a lot after reading this article, let's go to understand it!
Wechat reply principle:
When an ordinary Wechat user sends a message to a public account, the Wechat server first receives the message sent by the user
The user information and messages are then packaged into a packet in XML format, and the XML packet is submitted to the URL set by the developer through the POST method.
Question 1: why use $GLOBALS ["HTTP_RAW_POST_DATA"] to save data from POST instead of the $_ POST array?
Answer:
POST can only hold standard data types and cannot be parsed for things like XML, SOAP, or Application/Octet-steam.
While $GLOBALS ["HTTP_RAW_POST_DATA"] and $_ POST are the same, if the data from POST is recognized by PHP, it can be received with $GLOBALS ["HTTP_RAW_POST_DATA"].
Question 2: what are the parameters and return values of simplexml_load_file ()?
Answer:
Parameter meaning
String: the XML string to be processed.
Class: used to specify a new object, usually set to "SimpleXMLElement", to generate a class of simple XML elements.
Options: specifies an additional Libxml parameter, usually set to a constant LIBXML_NOCDATA, which means that CDATA is set as a text node.
Ns: general omission
Is_prefix: general omission
Returns an object of the SimpleXMLElement class when the function is finished.
Function: the official account only accepts text messages and makes corresponding text responses.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.