微信公眾平台開發簡訊嵌入超連結失敗,求助

來源:互聯網
上載者:User
$contentStr = "\n\n回複百度或回複“搜尋” 瞭解詳情\n其他文字";                                                                    $resultStr = sprintf($textTpl, $fromUsername, $toUsername, time(), $msgType, $contentStr);  /*$resultStr = "".$fromUsername." ".$toUsername." ".time()."text文本\n\n回複需要嵌入超連結的文本或回複“搜尋” 瞭解詳情\n其他文字";*/                echo $resultStr;           

希望做過公眾平台開發的指點下,網上說這麼弄可以,但我的一直不成功,求解釋


回複討論(解決方案)

$contentStr = "\n\n回複百度或回複“搜尋” 瞭解詳情\n其他文字";

$contentStr = "\n\n回複百度或回複“搜尋” 瞭解詳情\n其他文字";
難道這句話,你編輯器沒有報錯?

改成#1即可

或者
$contentStr = "\n\n回複百度或回複“搜尋” 瞭解詳情\n其他文字";

$contentStr = "\n\n回複百度或回複“搜尋” 瞭解詳情\n其他文字";

問題解決了!這個“\”有什麼用了?

$contentStr = "\n\n回複百度或回複“搜尋” 瞭解詳情\n其他文字";
難道這句話,你編輯器沒有報錯?

改成#1即可

或者
$contentStr = "\n\n回複百度或回複“搜尋” 瞭解詳情\n其他文字";

這個用單引號是不行的,在iPhone上可以,但是在安卓手機顯示異常。


$contentStr = "\n\n回複百度或回複“搜尋” 瞭解詳情\n其他文字";

問題解決了!這個“\”有什麼用了?



轉義


$contentStr = "\n\n回複百度或回複“搜尋” 瞭解詳情\n其他文字";
難道這句話,你編輯器沒有報錯?

改成#1即可

或者
$contentStr = "\n\n回複百度或回複“搜尋” 瞭解詳情\n其他文字";

這個用單引號是不行的,在iPhone上可以,但是在安卓手機顯示異常。


是否是同一段代碼?



$contentStr = "\n\n回複百度或回複“搜尋” 瞭解詳情\n其他文字";
難道這句話,你編輯器沒有報錯?

改成#1即可

或者
$contentStr = "\n\n回複百度或回複“搜尋” 瞭解詳情\n其他文字";

這個用單引號是不行的,在iPhone上可以,但是在安卓手機顯示異常。


是否是同一段代碼?

是的,簡訊的超鏈有時在安卓和IOS上不一樣


$contentStr = "\n\n回複百度或回複“搜尋” 瞭解詳情\n其他文字";

問題解決了!這個“\”有什麼用了?


這是轉義。。。。
基礎知識,建議LZ好好學習一下基礎知識。
  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.