【发布时间】:2017-08-24 10:44:41
【问题描述】:
我正在尝试使用twitterbot in php 写推文...
我会放入一个新行(\n<br>)但不起作用。
这是我的代码:
// OAuth To Twitter
require_once 'twitteroauth.php'; //INSIDE IT ther's a require_once OAuth.php file
$one_br= urlencode("\n");
// Do NOT Share
define("CONSUMER_KEY", "YOUR_APP_KEY");
define("CONSUMER_SECRET", "YOUR_APP_SECRET");
define("OAUTH_TOKEN", "YOUR_ACCOUNT_OAUTH_TOKEN");
define("OAUTH_SECRET", "YOUR_ACCOUNT_OAUTH_SECRET");
// Post To Twitter
$connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, OAUTH_TOKEN, OAUTH_SECRET);
$content = $connection->get('account/verify_credentials');
$connection->post('statuses/update', array('status' => 'Test %0a di prova'.$one_br.'#tweet automatico- Test 5'));
// All Done Here
输出
Test %0a di prova%0A#tweet automatico- Test 5
我希望你能帮助我:) 非常感谢:)
【问题讨论】:
标签: php html twitter escaping encode