Array access and modification
📖 Scenario: You are managing a small fruit store inventory. You have a list of fruits and their quantities. You want to update the quantities as fruits are sold or restocked.
🎯 Goal: Learn how to access and modify values in an array in PHP by updating fruit quantities.
📋 What You'll Learn
Create an associative array with fruit names as keys and quantities as values
Create a variable to hold the quantity to add or subtract
Modify the quantity of a specific fruit in the array
Print the updated array
💡 Why This Matters
🌍 Real World
Managing inventory in a store requires updating quantities as items are sold or restocked.
💼 Career
Knowing how to access and modify arrays is essential for backend development and data management.
Progress0 / 4 steps