0

我将 Buffer API 与 PHP 一起使用,但我不知道如何发布 € 符号。我试过不编码,url编码和utf8编码,但这些都没有奏效。

如果我尝试发布:“我口袋里有 5 欧元,哈哈”我得到的只是:“我口袋里有 5 欧元,哈哈”

我怎样才能发布这种符号?谢谢!

这是代码:

require_once 'class.bufferapp.php';
$buffer = new BufferPHP('1/XXXXXXXXXXXXXXXXXXXXXXX');
$data = array('profile_ids' => array());
$data['profile_ids'][] = 'XXXXXXXXXXXXXXXXXXX';


$data['text'] = "I have 5€ in my pocket lol";
$ret = $buffer->post('updates/create', $data);
var_dump($ret);

/* Response:

object(stdClass)#2 (5) { ["updates"]=> array(1) { [0]=> object(stdClass)#3 (16) { ["_id"]=> string(24) "XXXXXXXXXXXXXXXXXXXX" ["client_id"]=> string(24) "XXXXXXXXXXXXXXXXXXX" ["created_at"]=> int(1361285095) ["day"]=> string(5) "Today" ["due_at"]=> int(1361289540) ["due_time"]=> string(7) "4:59 pm" ["id"]=> string(24) "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" ["profile_id"]=> string(24) "XXXXXXXXXXXXXXXX" ["profile_service"]=> string(7) "twitter" ["status"]=> string(6) "buffer" ["text"]=> string(25) "I have 5 in my pocket lol" ["text_formatted"]=> string(25) "I have 5 in my pocket lol" ["type"]=> string(4) "text" ["updated_at"]=> int(1361285095) ["user_id"]=> string(24) "XXXXXXXXXXXXXXXXXXX" ["via"]=> string(3) "api" } } ["buffer_percentage"]=> int(20) ["buffer_count"]=> int(2) ["success"]=> bool(true) ["message"]=> string(49) "One more tweet in your Buffer. Keep it topped up!" }
4

2 回答 2

0

将符号替换为 €

于 2013-02-19T15:01:22.760 回答
-1

它对我有用\xE2\x82\xAc

希望对你有帮助!

于 2013-02-19T15:24:56.747 回答