方法:将网站用双括号括起来“ ”即可
$retMsg = '<a href="wangxiaoportal.sinaapp.com">免费上网链接</a> ';
实例:
if($xmlObj->Content=='免费上网')
{
$retMsg = '<a href="wangxiaoportal.sinaapp.com">免费上网链接</a> ';
}
$retTmp = "<xml>
<ToUserName><![CDATA[%s]]></ToUserName>
<FromUserName><![CDATA[%s]]></FromUserName>
<CreateTime>%s</CreateTime>
<MsgType><![CDATA[text]]></MsgType>
<Content><![CDATA[%s]]></Content>
<FuncFlag>0</FuncFlag>
</xml>";
$resultStr = sprintf($retTmp, $fromUserName, $toUserName, time(), $retMsg);
echo $resultStr