YAML or JSON
Yml vs Json
A make a small test to test YAML vs PHP performance. The result is:
A make a small test to test YAML vs PHP performance. The result is:
Example :
use Drupal\Component\Serialization\Json;
$json = Json::encode($data);
$data = Json::decode($json);
You can do that using Symfony JsonResponse.
Exemple 1.return new \Symfony\Component\HttpFoundation\JsonResponse($array);