munirmahmud6

Array

Mar 7th, 2019
473
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. //show array value using while loop
  2. $arrayInWhile = ['Bmw', 'Bekto', 444, 3.45];
  3. while( list( $key, $value ) = each( $arrayInWhile ) ) {
  4. echo $key;
  5. }
  6.  
  7. //Print associative array using for loop
  8. for( $i = 0; $i < count( $args ); $i++ ) {
  9. echo key($args) . '=' . current($args) . '<br>';
  10. next($args);
  11. }
  12.  
  13. //New Arrays that were done
  14. 1. array_change_key_case();
  15. 2. array_chunk();
  16. 3. array_column();
  17. 4. array_count_values();
  18. 5. array_fill();
  19. 6. array_fill_keys();
  20. 7. array_intersect();
  21. 8. array_intersect_key();
  22. 9. array_push();
  23. 10. array_pop();
  24. 11. array_unshift();
  25. 12. array_shift();
  26. 13. array_replace();
  27. 14. array_rand();
  28. 15. array_flip();
  29. 16. extract();
Add Comment
Please, Sign In to add comment