Aller au contenu

Do you support JSON with PHP?

Ce contenu n’est pas encore disponible dans votre langue.

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
$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.

To check your PHP version or settings, see PHP versions and default limits.

Cette page vous a-t-elle aidé ?