PHP SDK pagination
Iterate through paginated Telnyx API list results with the PHP SDK’s auto-pagination helpers.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Check out our upcoming events and meetups! View events →
Iterate through paginated Telnyx API list results with the PHP SDK’s auto-pagination helpers.
<?php
use Telnyx\Client;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
$page = $client->accessIPAddress->list(pageNumber: 1, pageSize: 50);
var_dump($page);
// fetch items from the current page
foreach ($page->getItems() as $item) {
var_dump($item->id);
}
// make additional network requests to fetch items from all pages, including and after the current page
foreach ($page->pagingEachItem() as $item) {
var_dump($item->id);
}
Was this page helpful?