# Do you support JSON with PHP?

> Yes. JSON support is built into PHP on Ruachost hosting and is on by default, so you can use json_encode and json_decode straight away.

Source: https://helpcenter.ruachost.com/faq/guides/do-you-support-json-with-php/

**Yes.** JSON support is built into PHP on Ruachost hosting and is on by default. You don't need to install or enable anything.

You can use PHP's JSON functions in any script:

- `json_encode()` turns a PHP array or object into JSON.
- `json_decode()` turns JSON into a PHP array or object.

```php
<?php
$data = ['name' => 'Ada', 'plan' => 'hosting'];
echo json_encode($data);

$obj = json_decode('{"status":"ok"}', true);
echo $obj['status'];
```

This is what most modern APIs, JavaScript front ends and plugins rely on, so WordPress, WooCommerce and similar applications work without extra setup.

> **Tip:**
If `json_decode()` returns `null`, call `json_last_error_msg()` to see why. The most common cause is invalid JSON, such as a trailing comma.

To check your PHP version or settings, see [PHP versions and default limits](https://helpcenter.ruachost.com/developers/php/php-versions-and-default-limits/).
