Answers for "php convert array of objects to json"

PHP
0

json to php array

<?php
        $json = '[{"name":"xxx","phone":"123","email":"[email protected]"},{"name":"yyy","phone":"456","email":"[email protected]"},{"name":"zzz","phone":"678","email":"[email protected]"}]';
        $json_decoded = json_decode($json);
        echo '<table>';
        foreach($json_decoded as $result){
          echo '<tr>';
            echo '<td>'.$result->name.'</td>';
            echo '<td>'.$result->phone.'</td>';
            echo '<td>'.$result->email.'</td>';
          echo '</tr>';
        }
        echo '</table>';
      ?>
Posted by: Guest on May-03-2022
0

how to convert array into json php

convert data
Posted by: Guest on January-15-2022

Code answers related to "php convert array of objects to json"

Browse Popular Code Answers by Language