- var_dump: documentation ( source)
- get_defined_constants: documentation ( source)
- strncmp: documentation ( source)
<?php
$constants = get_defined_constants(true);
$json_errors = array();
foreach ($constants["json"] as $name => $value) {
if (!strncmp($name, "JSON_ERROR_", 11)) {
$json_errors[$value] = $name;
}
}
var_dump($json_errors);