I'm counting folders with specific terms in them (works fine) and I want to put this into a bar graph (graph works fine) but I can't figure out how. I'm using a bar graph from chartphp.com The graph allows you to enter in information, but I want it dynamic.
Graph:
$p->data = array(array(array("2010/10",48.25),array("2011/01",238.75),array("2011/02",95.50),array("2011/03",300.50),array("2011/04",286.80),array("2011/05",400)));
My folder count data:
$dir = '../graphics/outputs';
$dirs = array_slice(scandir($dir), 2);
$help = array();
rsort($help);
for ($i = 0; $i < count($dirs); $i++) {
$name = substr($dirs[$i], 11);
if (isset($help[$name])) {
$help[$name]++;
} else {
$help[$name] = 1;
}
}
var_dump($help);
How do I get my folder count array into the graph without having to do it manually?
Also, my rsort($help); line doesn't seem to work and I don't know why?
Thanks for any ideas.