note 29477 deleted from function.var-dump by sniper

From: Date: Sun, 28 Sep 2003 22:38:52 +0000
Subject: note 29477 deleted from function.var-dump by sniper
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-57224@lists.php.net to get a copy of this message
Note Submitter: rolli@aum.unibe.ch ---- rudigier really good graph_var_dump script (see above) only works for 4 array levels then it gives an offset error. So I modified it to support an indefinite amount of levels: function graph_var_dump($vInput, $iLevel = 0) { $bg[0] = "#DDDDDD"; $bg[1] = "#C4F0FF"; $bg[2] = "#BDE9FF"; $bg[3] = "#FFF1CA"; ... With this change array index of $bg starts with 0 and has 4 elements. You could also define 5 or more color. Now replace $bg[$iLevel] with $bg[$iLevel%sizeof($bg)]. If iLevel is 23 now the script would use $bg[3] here in this example with 4 colors (23modulo4) ergo it's cycling through the colors.

« previous php.notes (#57224) next »