У нас вы можете посмотреть бесплатно Associative Arrays - PHP - P10 или скачать в максимальном доступном качестве, видео которое было загружено на ютуб. Для загрузки выберите вариант из формы ниже:
Если кнопки скачивания не
загрузились
НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если возникают проблемы со скачиванием видео, пожалуйста напишите в поддержку по адресу внизу
страницы.
Спасибо за использование сервиса ClipSaver.ru
What is an Associative Array? If you're familiar with other programming languages, an associative array is pretty much a dictionary. Instead of accessing the array by using an index value, you'll access it by using a key. That key points to a value. Keys in PHP can be integers or strings. If you attempt to store a floating point number as a key, it will be cast to an integer. Boolean value true will be case to 1 and false will be cast to 0. We can access a regular array with the index value of the element, but we have to use the assigned key value to access an associative array element. Why would you want to use an associative array over a regular array? If we had an array like the one below, how would we know what some of the values represent. We see that 32 is an element inside the array, but what does 32 actually mean? If we wanted to specify what each of those values meant, we could use strings as our keys and explicitly state what each of the elements represent. How do we access an element by using the key? By using the key instead of the integer index like we've been doing with simple arrays. The integer index value, because it hasn't been defined as a key, will throw an error. echo $person["name"]; // displays: Dino Cajic echo $person[0]; // Throws an error If we wanted to use an integer as a key, we could, but we probably shouldn't. To add a new element to the associative array, we use the array name, and between the appended brackets, we specify the key name. We'll use an integer value this time. $person[100] = "Hey There"; echo $person[100]; // Displays Hey There We can delete an element from an associative array by using the unset() function. unset( $person[100] ); // removes the Hey There element var_dump($person); // shows everything except Hey There. To modify an element, use the key where the value is located and assign a new value to it. $person["age"] = 33; // replaces 32 with 33 Read the full article on my website https://www.dinocajic.com/php-associa... Code for this tutorial https://github.com/dinocajic/php-7-yo... Full Code https://github.com/dinocajic/php-7-yo... PHP Playlist • PHP Tutorial -- Dino Cajic Author and Head of IT Homepage: https://www.dinocajic.com GitHub: https://github.com/dinocajic Medium: / dinocajic Instagram: / think.dino LinkedIn: / dinocajic Twitter: / dino_cajic My Books An Illustrative Introduction to Algorithms https://www.amazon.com/dp/1686863268 Laravel Excel: Using Laravel to Import Data https://amzn.to/4925ylw Code Along With Me - PHP: From Basic to Advanced PHP Techniques https://amzn.to/3M6tlGN