I want to add data to an array dynamically. How can I do that? Example
$arr1 = [ \'aaa\', \'bbb\', \'ccc\', ]; // How can I now add another value?
You should use method array_push to add value or array to array exists
$stack = array("orange", "banana"); array_push($stack, "apple", "raspberry"); print_r($stack); /** GENERATED OUTPUT Array ( [0] => orange [1] => banana [2] => apple [3] => raspberry ) */