Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
[ 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