Advertisement
aldinokemal

Array Merge

Sep 25th, 2022
744
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. $dataHari = ["Senin", "Selasa", "Rabu"];
  4. $dataBulan = ["Jan", "Feb", "Maret"];
  5.  
  6. $merge = [...$dataHari, ...$dataBulan]; // syntax php 7.4 keatas
  7. $merge2 = array_merge($dataHari, $dataBulan); // normal syntax
  8. print_r($merge);
  9. print_r($merge2);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement