This question already has an answer here:
Given this PHP array:
$options['systems'] = array(1, 2, 3)
How would I append the value 4
to the $systems
array within the $options
array?
</div>
This question already has an answer here:
Given this PHP array:
$options['systems'] = array(1, 2, 3)
How would I append the value 4
to the $systems
array within the $options
array?
</div>
You could use array_push to push additional items like so:
array_push($options['systems'], 4);
Or the shorthand version:
$options['systems'][] = 4;