Search
 
SCRIPT & CODE EXAMPLE
 

PHP

laravel api response json

return response()->json($array);
Comment

API json data show in laravel

$json_string =    file_get_contents("http://api.wunderground.com/api/7ec5f6510a4656df/geolookup/forecast/q/40121.json");
$parsed_json = json_decode($json_string, true);
$parsed_json = $parsed_json['forecast']['txt_forecast']['forecastday'];
//pr($parsed_json);

foreach($parsed_json as $key => $value)
{
   echo $value['period'] . '<br>';
   echo $value['icon'] . '<br>';
   // etc
}
Comment

API json data show in laravel

<?php
$json_string =    file_get_contents("http://api.wunderground.com/api/7ec5f6510a4656df/geolookup/forecast/q/40121.json");
$parsed_json = json_decode($json_string);
$temp = $parsed_json->{'forecast'}->{'txt_forecast'}->{'date'};
$title = $parsed_json->{'forecast'}->{'txt_forecast'}->{'forecastday'}->{'title'};
$for = $parsed_json->{'forecast'}->{'txt_forecast'}->{'forecastday'}->{'fcttext'};
echo "Current date is ${temp},  ${title}: ${for}
";

foreach($parsed_json['forecast']['forecastday[0]'] as $key => $value)
{
   echo $value['period'];
   echo $value['icon'];
   // etc
}
?>
Comment

how to get data from laravel api

[{"id_product":"62mQYOsEcRAZg56b1Y85","Product_Image":"https://firebasestorage.googleapis.com/v0/b/adey-dc43b.appspot.com/o/product_images%2F5d1d8c4a-1a53-4d18-a7ff-30cdc6245fe3?alt=media&token=ab09e791-c0a1-455e-bd37-2b0077924b8e","Business_ID":"uWPVn10xhw8ZVV65FTmz","Product_price":"50","Product_descr":"this book is designed for people who have passion on weitung letter ","Owner_id":"dur03ULzh3UGPqlXfyR9tAfEx2d2","Product_name":"new boook "}]
Comment

PREVIOUS NEXT
Code Example
Php :: laravel module make migration 
Php :: bootstrap pagination laravel 
Php :: string match in php 
Php :: php DateTime comparation 
Php :: why does php syntax doesnt work in my html 
Php :: change the date format in laravel view page 
Php :: laravel eloquent many to many query using whereHas 
Php :: how to display the site tagline in wordpress 
Php :: how to add share icon in wordpress 
Php :: php artisan create controller inside folder 
Php :: Instalar Lamp server en Ubuntu 
Php :: find over array object php find 
Php :: input file accept jpg jpeg png php 
Php :: Malformed UTF-8 characters, possibly incorrectly encoded 
Php :: submonth carbon 
Php :: laravel Class "PDO" not found 
Php :: php get data from url 
Php :: cakephp get sql query string 
Php :: json encode decode php 
Php :: filter collection (laravel) 
Php :: multi condition inside single if in php 
Php :: APP_DEBUG is set to true while APP_ENV is not local 
Php :: wordpress move debug.log 
Php :: valid image extensions in php 
Php :: how to maintain serial number in pagination in laravel blade 
Php :: create child theme in wordpress 
Php :: php json get value by key 
Php :: insert multiple rows laravel 
Php :: db transaction laravel 
Php :: php get item position in array 
ADD CONTENT
Topic
Content
Source link
Name
5+9 =