-1

Hi guys is there a way in php where in I can print this response prettier? For example, Print only the firstname, lastname, middlename of the response content.

Here's the response i got from the API enter image description here

I tried decoding the response with this code but still failed to get the key and values

    $students["mi"];
var_dump($students);

$s =  html_entity_decode($students);

Thank you so much for the help

tomerpacific
  • 4,704
  • 13
  • 34
  • 52
AmyllaVimiar
  • 315
  • 5
  • 24

1 Answers1

2

You could accessing the middlename of the firts row this way

$st = json_decode( $students);
$st[0]['middlename'];


var_dump( $st[0]['middlename']);
ScaisEdge
  • 131,976
  • 10
  • 91
  • 107