SHOW:
|
|
- or go back to the newest paste.
| 1 | <?php | |
| 2 | function array_filter_recursive(array $array) {
| |
| 3 | foreach($array as $key => $value) {
| |
| 4 | if (is_array($value)) {
| |
| 5 | array_filter_recursive($value) | |
| 6 | } | |
| 7 | if (empty($value)) {
| |
| 8 | unset($array[$key]); | |
| 9 | } | |
| 10 | } | |
| 11 | } | |
| 12 | ||
| 13 | require('phpQuery/phpQuery.php');
| |
| 14 | - | echo json_encode(array_filter($output), JSON_PRETTY_PRINT); |
| 14 | + | |
| 15 | $query = phpQuery::newDocument($html); | |
| 16 | $guild = $teste['.BoxContent td:contains("membership:")']->next()->text();
| |
| 17 | $guild = explode(' of the ', $guild);
| |
| 18 | $output = array( | |
| 19 | 'guild' => array( | |
| 20 | 'rank' => $guild[0], | |
| 21 | 'name' => $guild[1] | |
| 22 | ) | |
| 23 | ); | |
| 24 | header('Content-type: application/json');
| |
| 25 | echo json_encode(array_filter_recursive($output), JSON_PRETTY_PRINT); |