website
[mirrors/Programs.git] / bash / dewey_decimal_system / genjson.php
CommitLineData
0f2a9bdd
H
1#!/usr/bin/php
2<?php
3//You will need JSON PHP extension for this script...
4
5function recursive_scandir($path,&$dir) {
6 foreach($dir as $key => $value) {
7 $dir[$key] = array_flip(scandir($path.'/'.$key, 0));
8 unset($dir[$key]['.']); unset($dir[$key]['..']);
9 recursive_scandir($path.'/'.$key,$dir[$key]);
10 }
11}
12
13$dds = array_flip(array('dds'));
14recursive_scandir('./', $dds);
15
16//print_r($dds); //you can use this if you don't have JSON ext.
17echo json_encode($dds);
This page took 0.104242 seconds and 4 git commands to generate.