Skip to content

Arrays

IT Notes → PHP @ December 22, 2020

  • Arrays can be constructed using:
    • array () construct.
    • array operator [].
  • Arrays can be printed using:
    • print_ r() prints the array data recursively out and can be stored as a string.
    • var_dump( ) prints out the data and data type recursively.
    • var_export() prints out array data recursively as a PHP script.
  • array(key = value) and array[key]=value.
  • Merge arrays, e.g., $array3 = $array1 + $array2.
  • extract($arr,  EXTR_PREFIX_ALL).
  • count ($arr,1) will count recursively the number of elements.
  • The array cursors: reset(), end(), next(), and prev().
0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x