Summary
Keywords
Full Transcript
In PHP you can have regular index-based arrays also known as indexed arrays, you could also have arrays with custom keys also known as associative arrays & can have arrays within arrays which are called multi-dimensional arrays. You will learn all that you need to know about arrays to get started using them goes over how arrays are indexed by default & how re-indexing happens. Also, you will learn how to check if an element exists in an array at the specific key & the difference between array_key_exists & isset(). SOME OF THE WAYS YOU CAN SUPPORT THE CHANNEL 👍 Smash the like button 🤝 Subscribe to the channel & turn the notifications on 💬 Post comments, any feedback is greatly appreciated ⭐ Become a Patreon: https://www.patreon.com/programwithgio THANK YOU! LESSON 1.10 Course Outline - https://github.com/ggelashvili/learnphptherightway-outline Course Playlist - https://www.youtube.com/playlist?list=PLr3d3QYzkw2xabQRUpcZ_IBk9W50M9pe- CHAPTERS 00:00 - Intro 00:43 - What are arrays 01:27 - Indexed arrays & accessing elements 03:06 - Undefined array key 03:41 - Check if array key exists - isset() 04:04 - Mutate arrays 04:52 - Get length of array - count() 05:04 - Add elements to an array - square bracket syntax 05:37 - Add multiple elements to an array using array_push 06:05 - Name your keys (associative arrays) 07:11 - Add elements to associative arrays at specified keys 07:45 - Multi-dimensional arrays 10:02 - Duplicate keys & overwriting 11:18 - Having keys on only some elements & how automatic indexing works 12:05 - Removing an element from the end of an array using array_pop 12:27 - Removing an element from the beginning of an array using array_shift & re-indexing 13:14 - Removing element(s) from arrays by specifying keys using unset 13:59 - Using unset() does not re-index arrays 15:00 - Casting to arrays 15:27 - Another way to check if the key exists in array & the difference between array_key_exists & isset()
