Skip to content

Instantly share code, notes, and snippets.

@phpfiddle
Created May 19, 2017 18:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phpfiddle/917ca499396fe158b306ca5daa778abe to your computer and use it in GitHub Desktop.
Save phpfiddle/917ca499396fe158b306ca5daa778abe to your computer and use it in GitHub Desktop.
[ Posted by Hengky ] update array
<!-- *** PhpFiddle Lite *** -->
<?php
include_once ("http://www.sepatuonline.net/wp-content/themes/sandaljepit/scrape/simple_html_dom.php");
$urldata = preg_replace("/ /", "+","http://bandros.id/stok_api/produk/search/?apikey=mzlf6i0mcg&kode=L+174");
$html = file_get_html($urldata);
// this has to be in JSON format
echo json_decode($html);
$dataArray = $dataArray["result"]["stok"];
echo "<table>
<tr>
<td><strong>Ukuran</strong></td>";
foreach($dataArray as $item){
echo "<td>".$item["ukuran"]."</td>";
}
echo"</tr>";
echo "<tr>
<td><strong>Stok</strong></td>";
foreach($dataArray as $item)
echo" <td>". $item["stok"] ."</td>";
echo "</tr></table>";
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment