【问题标题】:Pushbullet PHP Api ListsPushbullet PHP API 列表
【发布时间】:2016-02-10 19:50:47
【问题描述】:

我正在使用 Pushbullet PHP API(下面的链接)并想要推送一个列表。 不幸的是,我听说推送列表(和地址)已被弃用。

https://github.com/ivkos/Pushbullet-for-PHP

现在我想将我的列表作为带有注释功能的字符串推送,每个项目后都有换行符

有人知道它是如何工作的或知道它仍在工作的库(或如何使用 curl)?

// $items = [] <- before;
$items = "";

for ($i = 0; $i < n; $i++) {
    // how i did it before
    //array_push($items, 'item i');
    // how can I do line break after the item, I tryed \n and %0A
    $items .= 'item i';
}

// doesn't work anymore
// $pushbullet->allDevices()->pushList( 'Title', $items );

$pushbullet
    ->allDevices()
    ->pushNote('Title', $items);

【问题讨论】:

    标签: php string pushbullet


    【解决方案1】:

    如果您想使用\n,请使用" 而不是'。更好的是使用 PHP_EOL

    $items .= 'item 1' . PHP_EOL;
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-10-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多