For example, a PHP file contains this:
<?php
return [
'sample_array' => [
'sample_index' => 'sample_data',
],
];
I would like to append values to sample_array using a PHP script. What would be the best way to do this?
Edit: After running the script, file should be updated to:
<?php
return [
'sample_array' => [
'sample_index' => 'sample_data',
'sample_index2' => 'sample_data2',
],
];
Edit: What I'm looking for is the creation of a script that will directly update the contents of the PHP file to append the array.
sample_arrayshould be appended with additional data (which would be hardcoded in the script) after running the script.