note 108496 deleted from function.rrd-info by danbrown

From: Date: Thu, 10 May 2012 16:53:45 +0000
Subject: note 108496 deleted from function.rrd-info by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-187607@lists.php.net to get a copy of this message
Note Submitter: caleb at calebgray dot com ---- I wasn't a fan of the previous solution for converting the array in to something usable. Usage is the same as rrd_tool, but this returns an object instead of an array. <?php function rrdinfo($filename) { $info = (object)array(); foreach (rrd_info($filename) as $key => $value) { $key = str_replace('.', '->', $key); //$value = addslashes($value); // Uncomment this line if your values have apostrophes in them. eval(is_numeric($value) ? "\$info->$key = $value;" : "\$info->$key = '$value';"); } return $info; } ?>

« previous php.notes (#187607) next »