Beginner PHP Arrays Tutorial (keys, values, const, vars, foreach)

Publié le: 28 août 2015
sur la chaîne: That Voxel Game
6,753
35

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


Sur cette page du site, vous pouvez voir la vidéo en ligne Beginner PHP Arrays Tutorial (keys, values, const, vars, foreach) durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur That Voxel Game 28 août 2015, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 6,753 fois et il a aimé 35 téléspectateurs. Bon visionnage!