I have a list of strings I need to convert into an array assignment
eg lets say I have a set of lines like this:
ctools_export_ui_list_form
masquerade_block_1
switchtheme_switch_form
backup_migrate_ui_manual_backup_load_profile_form
backup_migrate_ui_manual_backup_form
I need to create a variable assignment like this:
$conf['journal_form_ids'] = array(
'ctools_export_ui_list_form' => 0,
'masquerade_block_1' => 0,
'switchtheme_switch_form' => 0,
'backup_migrate_ui_manual_backup_load_profile_form' => 0,
'backup_migrate_ui_manual_backup_form' => 0,
);
My idea is to use some HEREDOC syntax:
$str = <<<EOD
ctools_export_ui_list_form
masquerade_block_1
switchtheme_switch_form
backup_migrate_ui_manual_backup_load_profile_form
backup_migrate_ui_manual_backup_form
EOD
and use that to create the variable assignment text and eval it, or some other suitable method.
Are there built in routines to make it elegant?