# $field->toData()

Parses the field value with the given method

****

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

****

```php
$field->toData(string $method = ','): array
```

## Parameters

| Name | Type | Default | Description |
| ---- | ---- | ---- | ---- |
| `$method` | `string` | `','` | [',', 'yaml', 'json'] |

## Return type

`array`

This method modifies the existing `$field` object it is applied to and returns it again.


## Available methods

split (`','`):
: pass any separator to split the value by the given character (default)

yaml:
: parses the value as yaml

json:
: parses the value as json