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

Pubblicato il: 28 agosto 2015
sul canale di: Ghost Telepathy
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


In questa pagina del sito puoi guardare il video online Beginner PHP Arrays Tutorial (keys, values, const, vars, foreach) della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Ghost Telepathy 28 agosto 2015, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 6,753 volte e gli è piaciuto 35 spettatori. Buona visione!