1 / 6

Mastering PHP Arrays and Sorting Techniques: A Comprehensive Guide

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.

star
Download Presentation

Mastering PHP Arrays and Sorting Techniques: A Comprehensive Guide

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Using ArraysPart II

  2. Sorting Arrays

  3. 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)

  4. Transforming Between Strings and Arrays • implode()  turns an array into a string • explode()  turns a string into an array

  5. Example • Script 7.7 (handle_list.php)

  6. Creating an Array from a Form • 7.8 (event.html) • Script 7.9 (handle_event.php)

More Related