0

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

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

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

有人知道它是如何工作的,或者知道它仍在工作的库(或者如何使用 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);
4

1 回答 1

1

"如果'您想使用\n. 更好的是使用 PHP_EOL

$items .= 'item 1' . PHP_EOL;
于 2016-02-10T19:56:49.673 回答