save_data
session.save
session.save_data
session.save_handler
D.
session.save_handler
<?php $i = 5;
while (--$i > 0 && ++$i){ print $i;
} ?>
5
555555555…infinitely
54321
error
<?php $a1 = array(red, green);
$a2 = array(blue, yellow);
print_r(array_merge($a1, $a2));
?>
Array ( [0] => red [1] => green)
Array ( [0] => blue [1] => yellow [2] => red [3] => green )
Array ( [0] => red [1] => green [2] => blue [3] => yellow )
Array ( [0] => blue [1] => yellow )
<?php define('GOOD_OCTAL', 0700);
define('BAD_OCTAL', 0600);
print GOOD_OCTAL;
print '
';
print BAD_OCTAL;
?>
384
0800
ERROR
No output
<?php $color1 = red;
$color2 = red;
echo $color1 + $color2;
?>
redgreen
red green
0
1
Which of following variables can be assigned a value to it?
i) $3hello
ii) $_hello
iii) $this
iv) $This
All of the mentioned
Only ii)
ii), iii) and iv)
ii) and iv)
<?php /*echo Hello world;
*/ ?>
Hello world
Nothing
Error
/* Hello world */
<?php $i = ;
while ($i = 10){ print hi;
}print hello;
?>
hello
infinite loop
hihello
error
Which of the following must be installed on your computer so as to run PHP script?
i) Adobe Dreamweaver
ii) PHP
iii) Apache
iv) IIS
All of the mentioned.
Only ii)
ii) and iii)
ii), iii) and iv)
session.domain
session.path
session.cookie_path
session.cookie_domain
<?php define(GREETING, PHP is a scripting language);
echo $GREETING;
?>
$GREETING
no output
PHP is a scripting language
GREETING
What does PHP stand for?
i) Personal Home Page
ii) Hypertext Preprocessor
iii) Pretext Hypertext Processor
iv) Preprocessor Home Page
Both i) and iii)
Both ii) and iv)
Only ii)
Both i) and ii)
<?php class myObject { }define('myObject::CONSTANT', 'test');
echo myObject::CONSTANT;
?>
test
error
myObject::CONSTANT
no output
<?php $cars = array(Volvo, BMW, Toyota);
echo I like . $cars[0] . , . $cars[1] . and . $cars[2] . .;
?>
I like Volvo BMW and Toyota.
I like Volvo, BMW and Toyota)
I like Volvo, BMW and Toyota.
I like. Volvo.,. BMW. and. Toyota)
Integer
String
Boolean
Float
PHPSESSID
PHPSESID
PHPSESSIONID
PHPIDSESS
<?php define(GREETING, PHP is a scripting language, true);
echo GREETING;
echo
echo GREETING;
?>
PHP is a scripting language
GREEtING
GREETING
PHP is a scripting language
<?php $color1 = red;
$color2 = 1;
$color3 = greyecho $color1 + $color2 . $color3;
?>
1grey
grey
0
red1grey
A PHP script should start with ___ and end with ___:
< php >
< ? php ?>
<?php ?>
<% %>
<?php $i = 2;
while (++$i){ while (--$i > 0) print $i;
} ?>
210
10
no output
infinite loop
<?php $cars = array(Volvo, BMW, Toyota, Honda, Mercedes, Opel);
print_r(array_chunk($cars, 2));
?>
Array ( [0] => Array ( [1] => Volvo [2] => BMW ) [1] => Array ( [1] => Toyota [2] => Honda ) [2] => Array ( [1] => Mercedes [2] => Opel ) )
Array ( [1] => Array ( [1] => Volvo [2] => BMW ) [2] => Array ( [1] => Toyota [2] => Honda ) [3] => Array ( [1] => Mercedes [2] => Opel ) )
Array ( [0] => Array ( [0] => Volvo [1] => Volvo ) [1] => Array ( [0] => BMW [1] => BMW ) [2] => Array ( [0] => Toyota [1] => Toyota ) )
Array ( [0] => Array ( [0] => Volvo [1] => BMW ) [1] => Array ( [0] => Toyota [1] => Honda ) [2] => Array ( [0] => Mercedes [1] => Opel ) )
3
4
5
6
Delete the previous session
Start a new session
Check whether a valid session exists
Handle the session
<?php $color1 = 1;
$color2 = 1;
echo $color1 + $color2;
?>
11
2
0
1
Session
Cookie
URL rewriting
Nothing happens
<?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 )
<?php class Constants{ define('MIN_VALUE', '0.0');
define('MAX_VALUE', '1.0');
public static function getMinValue() { return self::MIN_VALUE;
} public static function getMaxValue() { return self::MAX_VALUE;
}}echo Constants::getMinValue();
echo Constants::getMaxValue();
?>
0.01.0
01
No output
ERROR
Complete text representation of month
Day of month, with leading zero
Daylight saving time
Day of month, without zeros
<?php define('GREETING_TEST', 'PHP is a scripting language', true);
echo GREETING_TESt;
$changing_variable = 'test';
echo constant('GREETING_' . strtoupper($changing_variable));
?>
PHP is a scripting language
GREETING_TESt
PHP is a scripting language
GREETING_TEST
360
180
3600
1800
<?php $a = array(A, Cat, Dog, A, Dog);
print_r(array_count_values($a));
?>
Array ( [A] => 2 [Cat] => 1 [Dog] => 2 )
Array ( [A] => 2 [Cat] => 2 [Dog] => 1 )
Array ( [A] => 1 [Cat] => 1 [Dog] => 2 )
Array ( [A] => 2 [Cat] => 1 [Dog] => 1)