# Connection And Get Collections

### Code

```php
<?php

use Hasanmertermis\MilvusPhpClient\Domain\Milvus;

require_once __DIR__ . "/vendor/autoload.php";

$client = new Milvus();

$client->connection("localhost", 19530);

try {
    $collections = $client->getCollections();
    print_r($collections);
} catch (Exception $e) {
    print_r($e->getMessage());
}
```

### Response

```
Array
(
    [0] => example_collection
)

```

### Video

{% embed url="<https://www.youtube.com/watch?index=3&list=PLrrSRNa3n0g_GpfKd-xjTHm5aNCRmYKBr&v=K6JEyExvUEQ>" %}
