Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rezoanulhasan/arrayphp
https://github.com/rezoanulhasan/arrayphp
Last synced: 6 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/rezoanulhasan/arrayphp
- Owner: RezoanulHasan
- Created: 2023-09-25T16:19:22.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-09-25T16:48:59.000Z (about 1 year ago)
- Last Synced: 2023-09-26T04:29:19.122Z (about 1 year ago)
- Language: PHP
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# arrayphp
Task 1: String ManipulationCreate a string variable called $text with the value "The quick brown fox jumps over the lazy dog.". Write a PHP function which takes "$text" as an argument to:
Convert the string to all lowercase.
Replace "brown" with "red" in the string.
Print the modified text.
Task 2: Array Manipulation
Create an array called $numbers containing the numbers 1 to 10. Write a PHP function which takes the "$numbers" array as an argument to remove the even numbers from the array and print the resulting array.
Task 3: Array Sorting
Create an array called $grades with the following values: 85, 92, 78, 88, 95. Write a PHP function which takes "$grades" as an argument to sort the array in descending order and print the sorted grades as array.
Task 4: Multidimensional Array
Create a multidimensional array called $studentGrades to store the grades of three students. Each student has grades for three subjects: Math, English, and Science. Write a PHP function which takes "$studentGrades" as an argument to calculate and print the average grade for each student.
Task 5: Password Generator
Create a PHP function called generatePassword($length) that generates a random password of the specified length. The password should include lowercase letters, uppercase letters, numbers, and special characters (!@$%^&*()_+). Write a PHP program to generate a password with a length of 12 characters using this function and print the password.