Skip to content

Instantly share code, notes, and snippets.

@dedisuryadi
dedisuryadi / dom-xpath
Last active August 29, 2015 14:22
parse html with domdocument and xpath
<?php
$dom = new DOMDocument();
@$dom->loadHTML($url);
$xpath = new DOMXPath($dom);
$div = $xpath->query('//div');
$i = 0;
$q = 1;
foreach ($div as $book) {
@dedisuryadi
dedisuryadi / 0_reuse_code.js
Last active August 29, 2015 14:06
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console