Is it possible to extract the value of "image_url" from this link
http://theapache64.xyz:8080/gpix/v1/gpix?keyword=honda%20civic%202009&limit=1
and display as <img src="">
using php?
Is it possible to extract the value of "image_url" from this link
http://theapache64.xyz:8080/gpix/v1/gpix?keyword=honda%20civic%202009&limit=1
and display as <img src="">
using php?
You can fetch data from json as follow
<?php
$content = file_get_contents('http://theapache64.xyz:8080/gpix/v1/gpix?keyword=honda%20civic%202009&limit=1');
$arr = json_decode($content,true);
$url = $arr['data']['images'][0]['image_url'];
echo "<img src='".$url."'>";
?>
Thanks guys, I found a solution.
I will also post my solution here just in case other will encounter the same problem
<?php
$json_file = file_get_contents('http://theapache64.xyz:8080/gpix/v1/gpix?keyword='.$combineurl.'&limit=1');
$jfo = json_decode($json_file);
$posts = $jfo->data->images;
foreach ($posts as $post) {
?>
<img src="<?php echo $post->image_url; ?>" alt="" width="500">
<?php
}
?>