相对较新的Twitter API,我在使用rawurlencode()通过API 1.1发布到Twitter时遇到问题。当我发推文撇号时,通常情况下,它推文为HTML实体,文档说使用urlencode删除HTML实体。
$vinedesc = rawurlencode('Cameron doesn\'t like the Walmart playground prices... ');
$connection->post('statuses/update', array('status' => $vinedesc));
输出以下内容作为推文,包括百分比编码:
卡梅伦%20doesn%27吨%20like%第二十条%20Walmart%20playground%20prices ...%20
如何将此推文发布为:
Cameron不喜欢Walmart游乐场的价格......