fork download
  1. <?php
  2.  
  3. // your code goes here
  4.  
  5. $a = array('email'=>'orange@test','topic'=>'welcome onboard','timestamp'=>'2017-10-6');
  6.  
  7. $b = array();
  8. foreach($a as &$v){
  9. $b[] = &$v;
  10. }
  11. $b[2]='11';
Success #stdin #stdout 0.01s 82880KB
stdin
Standard input is empty
stdout
array(3) {
  ["email"]=>
  &string(11) "orange@test"
  ["topic"]=>
  &string(15) "welcome onboard"
  ["timestamp"]=>
  &string(2) "11"
}
array(3) {
  [0]=>
  &string(11) "orange@test"
  [1]=>
  &string(15) "welcome onboard"
  [2]=>
  &string(2) "11"
}