【问题标题】:New line in tweet with tweetbot in php?在 php 中使用 tweetbot 在推文中添加新行?
【发布时间】: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


    【解决方案1】:

    这样和我一起工作:

    $connection->post('statuses/update', array('status' => ' 你好,xxx,

    你今天好吗?

    -

    留空行

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-04-21
      • 1970-01-01
      • 2018-12-29
      • 2021-06-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多