微信公众平台开发文本消息嵌入超链接失败,求助

WBOY
Libérer: 2016-06-23 13:57:27
original
1339 Les gens l'ont consulté

$contentStr = "\n\n回复<a href="http://www.baidu.com/">百度</a>或回复“搜索” 了解详情\n其他文字";                                                                    $resultStr = sprintf($textTpl, $fromUsername, $toUsername, time(), $msgType, $contentStr);  /*$resultStr = "<xml>							<ToUserName><![CDATA[".$fromUsername."]]></ToUserName> 							<FromUserName><![CDATA[".$toUsername."]]></FromUserName> 							<CreateTime>".time()."</CreateTime>							<MsgType><![CDATA[text]]></MsgType>							<Content><![CDATA[文本\n\n回复<a href="http://www.baidu.com/">需要嵌入超链接的文本</a>或回复“搜索” 了解详情\n其他文字]]></Content>							</xml>";*/                echo $resultStr;           					
Copier après la connexion

希望做过微信公众平台开发的指点下,网上说这么弄可以,但我的一直不成功,求解释


回复讨论(解决方案)

$contentStr = "\n\n回复<a href=\"http://www.baidu.com/\">百度</a>或回复“搜索” 了解详情\n其他文字";
Copier après la connexion
Copier après la connexion
Copier après la connexion
Copier après la connexion

$contentStr = "\n\n回复百度或回复“搜索” 了解详情\n其他文字";
难道这句话,你编辑器没有报错?

改成#1即可

或者
$contentStr = "\n\n回复百度或回复“搜索” 了解详情\n其他文字";

$contentStr = "\n\n回复<a href=\"http://www.baidu.com/\">百度</a>或回复“搜索” 了解详情\n其他文字";
Copier après la connexion
Copier après la connexion
Copier après la connexion
Copier après la connexion

问题解决了!这个“\”有什么用了?

$contentStr = "\n\n回复百度或回复“搜索” 了解详情\n其他文字";
难道这句话,你编辑器没有报错?

改成#1即可

或者
$contentStr = "\n\n回复百度或回复“搜索” 了解详情\n其他文字";

这个用单引号是不行的,在iPhone上可以,但是在安卓手机显示异常。


$contentStr = "\n\n回复<a href=\"http://www.baidu.com/\">百度</a>或回复“搜索” 了解详情\n其他文字";
Copier après la connexion
Copier après la connexion
Copier après la connexion
Copier après la connexion

问题解决了!这个“\”有什么用了?



转义


$contentStr = "\n\n回复百度或回复“搜索” 了解详情\n其他文字";
难道这句话,你编辑器没有报错?

改成#1即可

或者
$contentStr = "\n\n回复百度或回复“搜索” 了解详情\n其他文字";

这个用单引号是不行的,在iPhone上可以,但是在安卓手机显示异常。


是否是同一段代码?



$contentStr = "\n\n回复百度或回复“搜索” 了解详情\n其他文字";
难道这句话,你编辑器没有报错?

改成#1即可

或者
$contentStr = "\n\n回复百度或回复“搜索” 了解详情\n其他文字";

这个用单引号是不行的,在iPhone上可以,但是在安卓手机显示异常。


是否是同一段代码?

是的,文本消息的超链有时在安卓和IOS上不一样


$contentStr = "\n\n回复<a href=\"http://www.baidu.com/\">百度</a>或回复“搜索” 了解详情\n其他文字";
Copier après la connexion
Copier après la connexion
Copier après la connexion
Copier après la connexion

问题解决了!这个“\”有什么用了?
这是转义。。。。
基础知识,建议LZ好好学习一下基础知识。
Étiquettes associées:
source:php.cn
Déclaration de ce site Web
Le contenu de cet article est volontairement contribué par les internautes et les droits d'auteur appartiennent à l'auteur original. Ce site n'assume aucune responsabilité légale correspondante. Si vous trouvez un contenu suspecté de plagiat ou de contrefaçon, veuillez contacter admin@php.cn
Tutoriels populaires
Plus>
Derniers téléchargements
Plus>
effets Web
Code source du site Web
Matériel du site Web
Modèle frontal
À propos de nous Clause de non-responsabilité Sitemap
Site Web PHP chinois:Formation PHP en ligne sur le bien-être public,Aidez les apprenants PHP à grandir rapidement!