From the course: Learning PHP
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Challenge: Sort an array of objects - PHP Tutorial
From the course: Learning PHP
Challenge: Sort an array of objects
(upbeat music) - [Instructor] Now that you know all about functions and classes, it's time to put that knowledge to use. On the screen here you see a simplified version of our person class. This information will be in the exercise files for this video. But your job will be to sort an array of person objects by last then first name and the array is provided for you in the exercise files as well. As a hint, you'll need to use a sort function that you already saw and be sure to have information about that spaceship operator handy. It will help.
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
What are functions?5m 11s
-
(Locked)
Using built-in functions4m 40s
-
(Locked)
Writing custom functions7m 10s
-
(Locked)
Union typing variables2m
-
(Locked)
Optional or named arguments5m 23s
-
(Locked)
Anonymous functions4m 32s
-
(Locked)
What are objects and classes?3m 21s
-
(Locked)
Defining a simple person class (update for PHP 8.0)3m 19s
-
(Locked)
Using the person class3m 25s
-
(Locked)
Challenge: Sort an array of objects46s
-
(Locked)
Solution: Sort an array of objects3m 26s
-
-
-
-
-
-