function _backup_migrate_array_to_ini in Backup and Migrate 6.3
Same name and namespace in other branches
- 8.2 backup_migrate.module \_backup_migrate_array_to_ini()
- 8.3 backup_migrate.module \_backup_migrate_array_to_ini()
- 7.3 backup_migrate.module \_backup_migrate_array_to_ini()
- 7.2 backup_migrate.module \_backup_migrate_array_to_ini()
Convert an associated array to an ini format string.
1 call to _backup_migrate_array_to_ini()
- backup_migrate_destination::create_info_file in includes/
destinations.inc - Create an ini file and write the meta data.
File
- ./
backup_migrate.module, line 1612 - Create (manually or scheduled) and restore backups of your Drupal MySQL database with an option to exclude table data (e.g. cache_*)
Code
function _backup_migrate_array_to_ini($data, $prefix = '') {
$content = "";
foreach ($data as $key => $val) {
if ($prefix) {
$key = $prefix . '[' . $key . ']';
}
if (is_array($val)) {
$content .= _backup_migrate_array_to_ini($val, $key);
}
else {
$content .= $key . " = \"" . $val . "\"\n";
}
}
return $content;
}