How well do you know PHP?

phpQ1: What is the output:

$x = 42;
echo isset($x);

Q2: What is the output:

$x = 1;
echo is_null($x);

Q3: Which Comments are legal?:

Q4: Are PHP variables case sensitive?

Q5: What is the output?

$a = round(4.123456, 3);
echo $a;

Q6: Can I run a php script from the command line?

Q7: What is the output?

echo ord(‘a’);

Q8: Can I get the screen resolution with php?

Q9: What is the output?

$sting = ‘I love Windows’;
echo str_replace(“Windows”, “Linux”, $string);

Q10: What is the output of the MySQL query below?

SET @str = BINARY ‘New York’;
SELECT LOWER(@str), LOWER(CONVERT(@str USING latin1));

Q11: What is the output of the MySQL query below?

SELECT RTRIM(‘barbar ‘);

Q12: What is the output of the MySQL query below?

SELECT RPAD(‘hi’,5,’?’);

Q13: What is the output of the MySQL query below?

SELECT SUBSTRING(‘Sakila’ FROM -4 FOR 2);

Q14: What is the output of the MySQL query below?

SELECT SUBSTRING(‘Quadratically’,5,6);

Q15: What is the output of the MySQL query below?

SELECT ‘2010-12-31 23:59:59’ + INTERVAL 1 SECOND;

Bonus Question:

$x=glob($path.’*’, GLOB_MARK|GLOB_ONLYDIR|GLOB_NOSORT);

What does the code above do?

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s