This topic describes how to use Tablestore SDK for PHP to list the names of data tables in a Tablestore instance.
Prerequisites
A client is initialized. For more information, see Initialize a Tablestore client.
Method description
public function listTable(array $request) Sample code
The following sample code demonstrates how to query the list of data tables in an instance and print the table names.
try{
$result = $client->listTable([]);
foreach ($result as $tableName) {
echo "$tableName\n";
}
} catch (Exception $e) {
echo "Failed to list table with error.";
}