In this tutorial, we’ll learn how arrays work in PHP. Arrays are one of the most important data structures in PHP, allowing you to store multiple values in a single variable.
Creating arrays with the [array()] keyword
Using constants and variables as array values
Automatic keys vs. manually defined keys
Mixing numeric and string keys
Using [print_r] and [var_dump] to inspect arrays
Looping through arrays with [foreach]
Testing whether keys are numeric or string with [is_numeric]
This tutorial is beginner-friendly and will give you a solid foundation for working with arrays in PHP.
⏱️ Timestamps
00:01 – Creating arrays with [array()]
01:13 – Outputting arrays using [print_r]
02:00 – Constants inside arrays (using [const])
03:14 – Variables as array values (using [$])
04:51 – Keys and values explained (index/value pairs)
05:40 – Defining keys manually in arrays
07:18 – Adding numeric values into arrays
08:00 – Out-of-order index keys allowed in PHP
09:26 – Formatting output with [pre] HTML tag
09:43 – Using strings as keys in arrays
12:16 – Inspecting arrays with [var_dump]
14:38 – Looping arrays with [foreach (key = value)]
17:14 – Detecting numeric keys with [is_numeric]
18:41 – Detecting string keys
19:55 – Understanding how PHP treats numbers vs strings in arrays
20:14 – Wrapping up and best practices
🏷️ Tags
php arrays tutorial,php array for beginners,php foreach array,php array keys values,php array print_r,var_dump php array,php associative arrays,php numeric vs string keys,php array tutorial,php programming tutorial
Nesta página do site você pode assistir ao vídeo on-line Beginner PHP Arrays Tutorial (keys, values, const, vars, foreach) duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário Ghost Telepathy 28 Agosto 2015, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 6,753 vezes e gostou 35 espectadores. Boa visualização!