- json_encode: documentation ( source)
<?php
echo json_encode([
'data' => [
'type' => 'customers',
'attributes' => [
// All those should fail
'title' => 'Monsieur',
'birth_date' => '18 years old',
'email' => 'monsieur@',
'phone' => 'CALL-ME',
],
],
], JSON_PRETTY_PRINT);