60 likes | 173 Views
This guide explores essential PHP array operations, focusing on sorting and transforming data. Learn how to create an array of student names with their corresponding grades, and see how to sort this array first by grade and then by name. You'll discover functions like `implode()` to convert arrays into strings and `explode()` for the opposite transformation. Additionally, this resource includes scripts for handling forms and events, providing practical examples that enhance your PHP programming skills.
E N D
Sorting Example • This example creates an array containing student names (indexes) and their grades (values) then the array is sorted by grade then by student name. • Script 7.5 (sort.php)
Transforming Between Strings and Arrays • implode() turns an array into a string • explode() turns a string into an array
Example • Script 7.7 (handle_list.php)
Creating an Array from a Form • 7.8 (event.html) • Script 7.9 (handle_event.php)