# youtube()

Embeds a YouTube video by URL in an iframe

****

- Source: <https://github.com/getkirby/kirby/tree/5.5.3/config/helpers.php#L685>

****

```php
youtube(string $url, array $options = [ ], array $attr = [ ]): string|null
```

## Parameters

| Name | Type | Default | Description |
| ---- | ---- | ---- | ---- |
| `$url` (required) | `string` | – | – |
| `$options` | `array` | `[ ]` | – |
| `$attr` | `array` | `[ ]` | – |

## Return types

`string` or `null`

## Examples

```php
<?= youtube('https://www.youtube.com/watch?v=mbyzgeee2mg') ?>
```