How can i Retrieve Image from Json in Php -


how can retrieve image json image stored in folder. name output name working did not show image. php

<?php   $json_file = file_get_contents('file.json');  $array = json_decode($json_file, true);         foreach ($array $key => $value) {       echo $value['name'];      echo $value['image'];      }  ?>  

json

[{      "name": "anyname"     "image": "img/bk.png"  }] 

try:

echo '<img src="' . $value['image'] . '" height="100%" width="100%">' 

Comments

Popular posts from this blog

'hasOwnProperty' in javascript -

python - ValueError: No axis named 1 for object type <class 'pandas.core.series.Series'> -

java - How to provide dependency injections in Eclipse RCP 3.x? -