HTML Academy
  • HTML Academy
  • Courses
  • Tutorials
  • Courses
  • Tutorials
  • Sign up
  • Log in
  • Home
  • Interactive courses
  • PHP basics
  1. Conditions in PHP 0/14
  2. Arrays and loops in PHP 0/15
  3. Arrays and functions in PHP 0/16
  4. Numbers and strings in PHP 0/14

Chapter 3: Arrays and functions in PHP

16 tasks, 1 summary

Learn how to create your own functions and use the built-in ones. We will explore how to use functions to sort, filter, copy, and shuffle arrays. We will finish the shipping status page and display random product listings on the main page of our store.

Start
1. Display all of the products from the order on the page Task
2. Declare and call the function Task
3. Function arguments Task
4. Functions return values Task
5. Passing the product ID to the function Task
6. Calculating the shipping cost Task
7. Optimizing the function Task
8. Built-in functions Task
9. The uasort function and sorting products Task
10. Changing the sorting direction Task
11. The array_slice function and retrieving part of an array Task
12. Determining which products are new arrivals Task
13. The array_filter function and filtering the array Task
14. Combining the arrays Task
15. The array_rand function and obtaining random elements Task
16. The shuffle function and shuffling the array Task
17. Summary of “Arrays and functions in PHP” Summary

Cookies ∙ Privacy ∙ License Agreement ∙ About ∙ Contacts ∙ © HTML Academy OÜ, 2019−2025

VISAMastercard

Log in

or

Forgot your password?

Sign up

Sign up

or
Log in

Restore access

Have you forgotten your password or lost access to your profile? Enter your email connected to your profile and we will send you a link to restore access.

Forgot to connect your email to the profile? Email us and we’ll help.

We are using cookies to gather information which will help you use our website most effectively. You can read about this here or disable this feature if you want. By continuing to browse the site, you agree to our use of cookies.