Guest User

Untitled

a guest
Jun 21st, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. <?php
  2.  
  3. Original data:
  4. ===============
  5. $result = array(
  6. '32' => 'Belgium',
  7. '31' => 'Holland,
  8. '44' => 'England',
  9. '39' => 'German',
  10. );
  11.  
  12. how can i add on top of this to make it like following:
  13.  
  14. Expected data:
  15. ==============
  16. $result = array(
  17. '' => '',
  18. '32' => 'Belgium',
  19. '31' => 'Holland,
  20. '44' => 'England',
  21. '39' => 'German',
  22. );
  23.  
  24.  
  25. Tried and getting fail to make the expected data:
  26. ===================================================
  27. **If i try array_merge it makes the keys with 0, 1, 2, 3, ... same for array_push,
  28. etc.., so i lose the country codes.
Add Comment
Please, Sign In to add comment