function charts_trim_array in Charts 7.2
Same name and namespace in other branches
- 8 includes/charts.pages.inc \charts_trim_array()
Recursive function to trim out empty options that aren't used.
4 calls to charts_trim_array()
- _charts_google_populate_chart_data in modules/
charts_google/ charts_google.inc - Utility to populate chart data.
- _charts_google_render in modules/
charts_google/ charts_google.inc - Chart render callback; Convert all chart-level data.
- _charts_highcharts_populate_chart_data in modules/
charts_highcharts/ charts_highcharts.inc - Utility to populate chart data.
- _charts_highcharts_render in modules/
charts_highcharts/ charts_highcharts.inc - Chart render callback; Convert all chart-level data.
File
- ./
charts.module, line 379 - Provides elements for rendering charts and Views integration.
Code
function charts_trim_array(&$array) {
foreach ($array as $key => &$value) {
if (is_array($value)) {
charts_trim_array($value);
}
elseif (is_null($value) || is_array($value) && count($value) === 0) {
unset($array[$key]);
}
}
}