我正在通过PHP cURL将类似下面的消息发布到Facebook:
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。对不起,我的英语