fork download
  1. <?php
  2.  
  3. $array = [
  4. 'mytv' => '2017',
  5. 'event' => 'old',
  6. ];
  7. $newArray = [];
  8. foreach ($array as $key => $value) {
  9. $newArray[$key . ':='] = $value;
  10. }
  11. echo json_encode($newArray);
Success #stdin #stdout 0.04s 24552KB
stdin
Standard input is empty
stdout
{"mytv:=":"2017","event:=":"old"}