Created
May 19, 2017 18:31
-
-
Save phpfiddle/917ca499396fe158b306ca5daa778abe to your computer and use it in GitHub Desktop.
[ Posted by Hengky ] update array
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- *** 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