“PHP Prueba JSON Decode y verifique” Código de respuesta

PHP JSON_DECODE

$personJSON = '{"name":"Johny Carson","title":"CTO"}';

$person = json_decode($personJSON);

echo $person->name; // Johny Carson
Grepper

PHP Decode JSON Object

<?php

$json = '{"firstName":"Peter","lastName:":"Silva","age":23}';

$personInfo = json_decode(json);

echo $personInfo->age;

?>
Apollo

PHP Prueba JSON Decode y verifique

// Checks if json
function isJson($string) {
   json_decode($string);
   return json_last_error() === JSON_ERROR_NONE;
}

// example
if (isJson($string) {
  // Do your stuff here
}
MaestroError

Respuestas similares a “PHP Prueba JSON Decode y verifique”

Preguntas similares a “PHP Prueba JSON Decode y verifique”

Más respuestas relacionadas con “PHP Prueba JSON Decode y verifique” en PHP

Explore las respuestas de código populares por idioma

Explorar otros lenguajes de código