Elance PHP5 code test (with answers)

Here is the list of problems with correct answers for Elance PHP5 Code Test:

1. recursive xml traversal:

2. (sql) select the second highest id from user table:

3. get checkbox values from POST:

4. get unique array elements:

5. generate random password:

6. split email addresses:

7. the most challenging task (for me). Phone regexps:

8. get longest string in arguments:

9. find maximum in nested array:

10. output all numbers divisable by 8 from 200 to 600 inclusive:

Note, that all answers are correct, but some of them are not optimized, so you may be in top 20% with this, but not higher. If someone would like to post any improvements to the code snippets above – they are welcome:)

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.