<?php $color1 = red;
$color2 = 1;
echo $color1 + $color2;
?>
red1
red 1
0
1
D. 1
totime(+45)
totime(+45 days)
strtotime(+45 days)
strtotime(-45 days)
Session
Cookie
URL rewriting
Nothing happens
<?php $a1 = array_fill(3, 4, blue);
$b1 = array_fill(0, 1, red);
print_r($a1);
echo
;
print_r($b1);
?>
Array ( [3] => blue [4] => blue)
Array ( [0] => red )
Array ( [4] => blue [5] => blue [6] => blue)
Array ( [0] => red )
Array ( [3] => blue [4] => blue [5] => blue [6] => blue )
Array ()
Array ( [3] => blue [4] => blue [5] => blue [6] => blue )
Array ( [0] => red )
<?php echo (checkdate(4,31,2010) ? 'Valid' : 'Invalid');
?>
TRUE
FALSE
Valid
Invalid
session.domain
session.path
session.cookie_path
session.cookie_domain
<?php define(VAR_NAME,test);
${VAR_NAME} = value;
echo VAR_NAME;
echo ${VAR_NAME};
?>
test
testtest
testvalue
error, constant value cannot be changed
<?php $color1 = red;
$color2 = red;
echo $color1 + $color2;
?>
redgreen
red green
0
1
<?php $i = ;
while ($i = 10){ print hi;
}print hello;
?>
hello
infinite loop
hihello
error
<?php $color1 = red;
$color2 = green;
echo $color1 . $color2;
?>
red
green
red green
redgreen
<?php $a = array(a=>red, b=>green, c=>blue);
echo array_shift($a);
print_r ($a);
?>
green
red
redArray( [c] => green [c] => blue )
redArray( [b] => green [c] => blue )
3600 sec
3600 min
3600 hrs
the browser is restarted
<?php $i = 0;
while (++$i && --$i){ print $i;
} ?>
1234567891011121314….infinitely
01234567891011121314…infinitely
no output
error
<?php define(__LINE__, PHP is a scripting language);
echo __LINE__;
?>
PHP is a scripting language
__LINE__
2
ERROR
<?php $color1 = 1;
$color2 = 1;
echo $color1 + $color2;
?>
11
2
0
1
<?php $a = array(red, green, blue);
array_pop($a);
print_r($a);
?>
Array ( [0] => red [1] => green )
Array ( [0] => green [1] => blue )
Array ( [0] => red [1] => blue )
Array ( [0] => blue [1] => blue )
Which of the following PHP statements will output Hello World on the screen?
i) echo (“Hello World”);
ii) print (“Hello World”);
iii) printf (“Hello World”);
iv) sprintf (“Hello World”);
i) and ii)
i), ii) and iii)
All of the mentioned
i), ii) and iv)
Delete the previous session
Start a new session
Check whether a valid session exists
Handle the session
<?php printf( date(t) ) ?>
30
22
JUNE
2013
<?php echo Today is .date(F d, Y) ?>
Today is 22 June, 2013
Today is 22-06-2013
Today is 06-22-2013
Today is June 22, 2013
<?php $i = 2;
while (++$i){ while (--$i > 0) print $i;
} ?>
210
10
no output
infinite loop
<?php define('IF', 42);
echo IF: , IF;
?>
IF:42
No output
IF:
ERROR
T
N
E
I
3
4
5
6
lastmod()
getlastmod()
last_mod()
get_last_mod()
<?php class myObject { }define('myObject::CONSTANT', 'test');
echo myObject::CONSTANT;
?>
test
error
myObject::CONSTANT
no output
Which of the following is/are a PHP code editor?
i) Notepad
ii) Notepad++
iii) Adobe Dreamweaver
iv) PDT
Only iv)
All of the mentioned.
i), ii) and iii)
Only iii)
<?php $i = 5;
while (--$i > 0 && ++$i){ print $i;
} ?>
5
555555555…infinitely
54321
error
time()
mktime()
mrtime()
mtime()
A PHP script should start with ___ and end with ___:
< php >
< ? php ?>
<?php ?>
<% %>
<?php $color = red;
$color = green;
echo $color;
?>
red
green
red green
error