“PHP Parse Json” Kod odpowiedzi

PHP Parse Json

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

$person = json_decode($personJSON);

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

PHP Dekoduj plik JSON

$json = json_decode(file_get_contents('/path/to/your/file.json'));
Kaotik

JavaScript Parse Json

var jsonPerson = '{"first_name":"billy", "age":23}';
var personObject = JSON.parse(jsonPerson); //parse json string into JS object
Grepper

JavaScript Parse Json

const json = '{ "fruit": "pineapple", "fingers": 10 }';
const obj = JSON.parse(json);
console.log(obj.fruit, obj.fingers);
Distinct Dormouse

JSON dekoduj tablicę php

<?php
    $json=file_get_contents("http://west.basketball.nl/db/json/stand.pl?szn_Naam=2014-2015&cmp_ID=373");
    $data =  json_decode($json);

    if (count($data->stand)) {
        // Open the table
        echo "<table>";

        // Cycle through the array
        foreach ($data->stand as $idx => $stand) {

            // Output a row
            echo "<tr>";
            echo "<td>$stand->afko</td>";
            echo "<td>$stand->positie</td>";
            echo "</tr>";
        }

        // Close the table
        echo "</table>";
    }
?>
Fierce Fly

PHP Parse Json

// scrap this:
$data = json_decode($rawdata);

// use this:
$data = json_decode($rawdata, true);
echo $data["key1"];
Supreme Oreo

Odpowiedzi podobne do “PHP Parse Json”

Pytania podobne do “PHP Parse Json”

Więcej pokrewnych odpowiedzi na “PHP Parse Json” w PHP

Przeglądaj popularne odpowiedzi na kod według języka

Przeglądaj inne języki kodu