Horje
read-json-data-response-using-php Code Example
read-json-data-response-using-php
$json = '[
    {
        "displayName": "testing",
        "preferredUsername": "testing",
    }
]';

$jsonArray = json_decode($json);

foreach($jsonArray as $value){
    $displayName = $value->Display Name;
    $preferredUsername = $value->Preferred User;
}
read-json-data-response-using-php
$json_data = '{
      "stat": "ok",
      "profile": {
        "providerName": "testing",
        "identifier": "http://testing.com/58263223",
        "displayName": "testing",
        "preferredUsername": "testing",
        "name": {
          "formatted": "testing"
        },
        "url": "http://testing.com/testing/",
        "photo": "https://securecdn.testing.com/uploads/users/5826/3223/avatar32.jpg?1373393837",
        "providerSpecifier": "testing"
      }
    }';

$json = json_decode($json_data);

echo $json->profile->displayName;
echo $json->profile->preferredUsername;




Shell

Related
bash comment section to a file Code Example bash comment section to a file Code Example
ubuntu tar all .log and .txt Code Example ubuntu tar all .log and .txt Code Example
linux show ssh users Code Example linux show ssh users Code Example
install rabbitmq in ubuntu 20.04 Code Example install rabbitmq in ubuntu 20.04 Code Example
s3 upload file cli Code Example s3 upload file cli Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
10