$postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);
$fromUsername = $postObj->FromUserName;
$toUsername = $postObj->ToUserName;
$keyword = trim($postObj->Content);
$time = time();
$textTpl = '<xml>
<ToUserName><![CDATA[%s]]></ToUserName>
<FromUserName><![CDATA[%s]]></FromUserName>
<CreateTime>%s</CreateTime>
<MsgType><![CDATA[%s]]></MsgType>
<Content><![CDATA[%s]]></Content>
</xml>';
$msgType = 'text';
$resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType,"<a href=\"http://baidu.com\">百度一下,你就知道</a>");
echo $resultStr;
手机端ok的
网页版无效