Fun with PHP Functions
For this exercise, I am going to use the following variables
- $name = Claude Swanson
- $dob = 1962-04-22
- $today = 2024-12-10
Fun with String Functions
- My name is 14 characters long.
- Here's my name in uppercase: CLAUDE SWANSON
- Here's my name in lowercase: claude swanson
- Here's my last name using the substr function.
Swanson
Fun with String Functions
- Today is: 2024-12-10
- My birthday is: 1962-04-22
- I am 22878 days old.
Fun with Array Functions
- Here is my first php array: Array
(
[0] => apples
[1] => bananas
[2] => peaches
[3] => strawberries
)
- Here, I append two elements to my array. Array
(
[0] => apples
[1] => bananas
[2] => peaches
[3] => strawberries
[4] => blackberries
[5] => grapes
)
- Here, I remove the first element of my array: Array
(
[1] => bananas
[2] => peaches
[3] => strawberries
[4] => blackberries
[5] => grapes
)
- Here, I update the value of an element in my array. Array
(
[1] => bananas
[2] => apples
[3] => strawberries
[4] => blackberries
[5] => grapes
)