0
我張貼喜歡通過PHP捲曲下一個Facebook的消息後失蹤:PHP換行符被張貼
Hello world
This is a test
#hash
在Facebook上牆的條目丟失的換行符 - 文字是這樣的:
Hello world This is a test #hash
這是我的代碼:
$attachment = array(
'access_token' => $token,
'message' => $postMessage
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,'https://graph.facebook.com/'.$profileID.'/feed');
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $attachment);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
如何使換行符被髮送給?
P.S.對不起,我的英語
嘗試使用\ n在$ postMessage的,也許它的工作原理 – JohannesB
或者,如果有什麼@Rsauxil說不行,請嘗試
標籤? – leftclickben
運行你的內容的nl2br函數或樣式包含白色空間的元素:pre-wrap – Orangepill