Search
 
SCRIPT & CODE EXAMPLE
 

PHP

jsondecode

<?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>";
    }
?>
Comment

jsondecode

<?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>";
    }
?>
Comment

jsondecode

<?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>";
    }
?>
Comment

how jsonDecode works

const jsonString =
    '{"text": "foo", "value": 1, "status": false, "extra": null}';

final data = jsonDecode(jsonString);
print(data['text']); // foo
print(data['value']); // 1
print(data['status']); // false
print(data['extra']); // null

const jsonArray = '''
  [{"text": "foo", "value": 1, "status": true},
   {"text": "bar", "value": 2, "status": false}]
''';

final List<dynamic> dataList = jsonDecode(jsonArray);
print(dataList[0]); // {text: foo, value: 1, status: true}
print(dataList[1]); // {text: bar, value: 2, status: false}

final item = dataList[0];
print(item['text']); // foo
print(item['value']); // 1
print(item['status']); // false
Comment

PREVIOUS NEXT
Code Example
Php :: @yield laravel 
Php :: document ready wordpress 
Php :: php get time past midnight 
Php :: PHP exif_read_data() 
Php :: Cannot modify header information - headers already sent by 
Php :: wordpress get default date format 
Php :: how to get today week month ad year data in eloquent 
Php :: php 2 decimal even if not exists 
Php :: foreach loop in php stack overflow 
Php :: Laravel Extract Values From Collection Using Pluck() with Relationship 
Php :: php enablem mod 
Php :: routing in laravel 
Php :: php sqlite last insert id 
Php :: laravel eloquent update quantity 
Php :: php two array difference merge recursive 
Php :: connect an if statement to an input php 
Php :: get ids from object 
Php :: PHP substr_replace — Replace text within a portion of a string 
Php :: php console print 
Php :: Publish Spatie Laravel Permission 
Php :: magento check which user has added a product 
Php :: laravel blade @if 3 varabile 
Php :: sweet alert confirm box laravel 
Php :: create factory in laravel 8 
Php :: controller class does not exist laravel 
Php :: laravel relationship 
Php :: Laravel - multiple select query 
Php :: Code for finding Prime Numbers 
Php :: cron job setting for laravel in cpanel 
Php :: mezzio quick start templating with laminas view 
ADD CONTENT
Topic
Content
Source link
Name
2+5 =