An open API service indexing awesome lists of open source software.

https://github.com/julianamancera/appdev_lab-5_php

Applications Development & Emerging Technologies - PHP Lab Activity #5
https://github.com/julianamancera/appdev_lab-5_php

application-development emerging-technology php

Last synced: 3 months ago
JSON representation

Applications Development & Emerging Technologies - PHP Lab Activity #5

Awesome Lists containing this project

README

        

# AppDev_Lab-5_PHP

## Names Challenge
**Instructions**

1. Take the array of names below and loop through them. The type of loop is up to you.

`$names = ['ALEC', 'BETH', 'CAROLINE', 'DAve', 'ElAnor', 'ANNa', 'Freddie', 'AdaM'];`

2. Within the loop, use a conditional statement to check if the first letter of the name is `A`.

3. If the first letter is `A`, skip that name and continue to the next iteration.

4. If the first letter is not `A`, reverse the string.

5. Make all names lowercase before printing them.

### Hints
- You can use indexes to access the first character of a string. ($string[0]) or you can use the `substr()` function.
- You can reverse a string using the `strrev()` function.
- You can make a string lowercase using the `strtolower()` function.
- You can skip an iteration of a loop using the `continue` keyword.

**The result should like this**

hteb
enilorac
evad
ronale
eidderf