A: 

Briefly glancing over your answers, I see that your answer for Q19 is wrong:

<?php

function magic($p, $q)
{
    return ($q == 0) 
    ? $q
    : magic($q, $p % $q); 
}

?>

The answer is

d) Determines the greatest common divisor between them

Its called Euclid's Algorithm. Fairly standard (and useful) algorithm.

EDIT: Although, looking back, I sincerely hope that you transcribed this incorrectly, as it should be this:

<?php

function magic($p, $q)
{
    return ($q == 0) 
    ? $p                       # P not Q, otherwise it would always return 0
    : magic($q, $p % $q); 
}

?>
Stargazer712
@Stargazer712: Shouldn't it return `$p` if `$q==0` then? Actually, this function as written **always** returns 0.
Borealid
I was just noticing the same thing :)
Stargazer712
@Stargazer712 and @Borealid thanks for your feed back. actually you are both right, it should $p instead of $q. thanks for pointing it out. my bad.
getmizanur