用php中的tweetbot在tweet中添加新行?
我正试图用php中的twitterbot写一篇推文。。。 我会放进一个新行(用php中的tweetbot在tweet中添加新行?,php,html,twitter,escaping,encode,Php,Html,Twitter,Escaping,Encode,我正试图用php中的twitterbot写一篇推文。。。 我会放进一个新行(\n),但不起作用 这是我的代码: // 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("
\n
),但不起作用
这是我的代码:
// 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
我希望你能帮助我:)
非常感谢:)这样与我一起工作:
$connection->post('status/update',数组('status'=>'
你好,xxxx
你今天好吗
-
只需留下空行这样与我一起工作:
$connection->post('status/update',数组('status'=>'
你好,xxxx
你今天好吗
-
请留下空行