课程: Level Up: PHP
今天就学习课程吧!
今天就开通帐号,24,700 门业界名师课程任您挑!
Sort people by age: Sorting an array of objects
(digital music) - Let's say you're building a student database and you want to get a good idea of the age range of everyone that's in the database so you can get a general idea of how big each class will be. To do this, you're going to sort the students in age order from youngest to oldest. Your requirements will be to sort the provided array of person objects by age, from youngest to oldest and don't write the sort on your own. Find and use PHP's built-in sorting function. You'll also have to refactor the compare age's function from the previous challenge to work in conjunction with PHP's built-in sorting function. Some important notes. This will use the previous and provided person class. Part of your challenge is to figure out what the built-in PHP function is and how it works and the output should be a fully sorted array. The helper function print array will print everything in a mostly readable way so you can eyeball…
内容
-
-
-
Event capacity: Compare two numbers3 分钟 18 秒
-
(已锁定)
Flip a coin2 分钟 40 秒
-
(已锁定)
Fizz buzz3 分钟 53 秒
-
(已锁定)
Given a birth date, determine age3 分钟 54 秒
-
(已锁定)
Determine who's older: Comparing objects4 分钟 13 秒
-
(已锁定)
Sort people by age: Sorting an array of objects5 分钟 35 秒
-
(已锁定)
Extend a class6 分钟 17 秒
-
(已锁定)
Determine a palindrome5 分钟 14 秒
-
(已锁定)
Process a simple contact form4 分钟 15 秒
-
(已锁定)
Store and retrieve data from a cookie4 分钟 24 秒
-
(已锁定)
Send an email6 分钟 8 秒
-
(已锁定)
Create functions in a namespace5 分钟 7 秒
-
(已锁定)
Build a calculator form5 分钟 17 秒
-
(已锁定)
Write a number guessing game7 分钟 38 秒
-
(已锁定)
Retrieve and display data from a provided REST API6 分钟 52 秒
-
(已锁定)
The Dutch national flag problem4 分钟 13 秒
-
(已锁定)
Create a Singleton design pattern4 分钟 10 秒
-
(已锁定)
Encrypt then decrypt a string6 分钟 32 秒
-
(已锁定)
Write a login form8 分钟 7 秒
-