开发者

facebook Graph API post to wall doesn't accept new line

开发者 https://www.devze.com 2023-04-06 19:42 出处:网络
I am developing a small application for facebook. In my application I post content to a fan page\'s wall.

I am developing a small application for facebook. In my application I post content to a fan page's wall.

When the user 开发者_如何学Centers a new line character the post completely ignores it. How can I solve this?


IF you send the following text

hello%0Aline+2

The posted message will look like

hello
line 2

Checked it right now:)


this work fine for me:

// first: replace normal \n (or "\\n") for "\r\n"
$mensaje=str_replace("\\n","\r\n",$reg['mensaje']);

// second: this only is for clear special characters
$mensaje=utf8_encode($mensaje);


Use html_entities, otherwise the POST request is not transferred properly.


use \r\n without any spaces in facebook graph api then you will get line break

0

精彩评论

暂无评论...
验证码 换一张
取 消