Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Check Answer
113. Which of the following modifiers are allowed for methods in an Interface? (choose all that apply)
Public
Protected
Abstract
Private
All of the above
Answer
Correct Answer:
Public Abstract
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Check Answer
114. Which of the following MySQL fetch constants imply: if the columns are returned into the array having both a numerical index and the field name as the array index?
MYSQL_BOTH
MYSQL_NUM
MYSQL_ASSOC
All of the above
Answer
Correct Answer:
MYSQL_BOTH
Note: This Question is unanswered, help us to find answer for this one
Check Answer
115.
What are methods in PHP?
Individual actions that an object will be able to perform are defined within the class as methods.
An individual instance of the data structure defined by a class.
These are the function defined inside a class and are used to access object data.
These are the functions in which the objects of the class are saved.
Answer
Correct Answer:
Individual actions that an object will be able to perform are defined within the class as methods. These are the function defined inside a class and are used to access object data.
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Check Answer
116.
Which of these is not a valid PHP XML DOM method?
getElementsByTagName
removeChild()
getElementsById()
appendChild()
Answer
Correct Answer:
getElementsById()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
117.
func_num_args returns ___________________.
Number of parameter passed into the function
Number of variables defined into the function
Both of the above
None of the above
Answer
Correct Answer:
Number of parameter passed into the function
Note: This Question is unanswered, help us to find answer for this one
Check Answer
118.
'Paamayim Nekudotayim' is also called :
Exponentiation operator
Scope resolution operator
Modulus operator
Logical operators
Answer
Correct Answer:
Scope resolution operator
Note: This Question is unanswered, help us to find answer for this one
Check Answer
119.
What will be the output of the code?
4
3
float(3)
floor(3)
Note: This Question is unanswered, help us to find answer for this one
Check Answer
120.
The _________ statement takes all the text/code/markup that exists in the specified file and copies it into the file that uses the statement. Check all that apply.
require
include
get
add
Answer
Correct Answer:
require include
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Check Answer
121.
Where can protected property or method be accessed?
it can only be accessed within the class itself.
it can be accessed outside of the class.
it can only be accessed within the class itself or in descendant classes.
It can not be accessed anywhere.
Answer
Correct Answer:
it can only be accessed within the class itself or in descendant classes.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
122.
How to rename a file in PHP?
file_rename(oldname, newname)
file(oldname, newname)
rename(oldname, newname);
file_change(oldname, newname)
Answer
Correct Answer:
rename(oldname, newname);
Note: This Question is unanswered, help us to find answer for this one
Check Answer
123.
Which of the following is used to send mail in PHP?
send_mail(to,subject,message,headers,parameters);
mail(to,subject,message,headers,parameters);
mail::(to,subject,message,headers,parameters);
mail_to(to,subject,message,headers,parameters);
Answer
Correct Answer:
mail(to,subject,message,headers,parameters);
Note: This Question is unanswered, help us to find answer for this one
Check Answer
124.
Which of the following will detect which request type was used (GET, POST, PUT or DELETE)?
$method = explode("/", substr(@$_SERVER['PATH_INFO'], 1));
$method = $_GET['REQUEST_METHOD'];
$method = $_SERVER['REQUEST_METHOD'];
$method = $_POST['REQUEST_METHOD'];
Answer
Correct Answer:
$method = $_SERVER['REQUEST_METHOD'];
Note: This Question is unanswered, help us to find answer for this one
Check Answer
125.
If the directive session.cookie_lifetime is set to 3600, the cookie will live until .........
3600 min
3600 sec
3600 hrs
The browser is restarted
Note: This Question is unanswered, help us to find answer for this one
Check Answer
126.
Which in-built function will add a value to the end of an array?
array_unshift()
into_array()
inend_array()
array_push()
Answer
Correct Answer:
array_push()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
127.
Placing the ____ symbol before a function tells PHP to suppress any errors generated by that function.
!
@
#
$
Note: This Question is unanswered, help us to find answer for this one
Check Answer
128.
Which of the following options will fail to remove the element "y" when placed in the blank space in the below sample code? $row = array(0 => "x", 1 => "y", 2 => "z", 3 => "w"); ___________ print_r($row);
unset($row[1]);
array_splice($row, 1, 1);
$row=array_diff_key($row, [1 => "mn"]);
array_diff($row, ["y"]);
Answer
Correct Answer:
array_diff($row, ["y"]);
Note: This Question is unanswered, help us to find answer for this one
Check Answer
129.
Which statement is incorrect?
unset($var) remove $var from the symbol table
unset() forces the PHP garbage collector to immediately free up memory
The PHP passthru() function helps in executing a program
The PHP system() function executes an external program and displays only the last line as output
Answer
Correct Answer:
The PHP system() function executes an external program and displays only the last line as output
Note: This Question is unanswered, help us to find answer for this one
Check Answer
130.
Which one of the following keywords is used to inherit our subclass into a superclass?
extends
implements
inherit
include
Note: This Question is unanswered, help us to find answer for this one
Check Answer
131.
Which expression will return true for below sample code? $a = true; $b = false;
$c = ($a and $b);
$c = $a && $b;
$c = $a and $b;
None of the above
Answer
Correct Answer:
$c = $a and $b;
Note: This Question is unanswered, help us to find answer for this one
Check Answer
132.
Which of the following would show an error in PHP?
echo @(1/0);
$var = @new className();
@echo 1;
@functionName();
Note: This Question is unanswered, help us to find answer for this one
Check Answer
133.
Which statement is not correct? $x = null;
empty($x) return TRUE
is_null($x) return FALSE
isset($x) return FALSE
None of the above
Answer
Correct Answer:
empty($x) return TRUE
Note: This Question is unanswered, help us to find answer for this one
Check Answer
134.
By default, every database connection opened by a script is either explicitly closed by the user during run time or released ____________ at the end of the script.
automatically
manually
server-side
sql
Answer
Correct Answer:
automatically
Note: This Question is unanswered, help us to find answer for this one
Check Answer
135.
Which statement is not correct?
PHP_OS: Returns information about the operating system PHP is running on
PHP_EOL: The correct 'End Of Line' symbol for this platform
PHP_MAXPATHLEN: The maximum length of filenames (including path) supported by this build of PHP.
PHP_INT_SIZE: The size of an integer in bytes in this build of PHP.
Answer
Correct Answer:
PHP_OS: Returns information about the operating system PHP is running on
Note: This Question is unanswered, help us to find answer for this one
Check Answer
136.
Which of the following would produce an error: $currentDT=new DateTime();
$newDT=clone $currentDT;
$currentDT->modify("+1 Hour");
$currentDT->add(new DateInterval('P00D'));
$currentDT->getTimezone(new DateTimezone('UTC'));
Answer
Correct Answer:
$newDT=clone $currentDT;
Note: This Question is unanswered, help us to find answer for this one
Check Answer
137.
Which of the following is not a Super Global variable in PHP?
$_ENV
$GLOBALS
$_SERVER
None of the above
Answer
Correct Answer:
None of the above
Note: This Question is unanswered, help us to find answer for this one
Check Answer
138.
Which of the following will decode a JSON variable $json to an object? $json = '{"abc":1,"def":2,"ghi":3,"jkl":4,"mno":5}';
$object = json_decode($json);
$object = json_decode($json,true);
Both of the above
None of the above
Answer
Correct Answer:
$object = json_decode($json,true);
Note: This Question is unanswered, help us to find answer for this one
Check Answer
139.
What would be the output of the I and II sample codes: I) $a = array(); $b = $a; $b['foo'] = 42; echo $a['foo']; II) $a = new StdClass(); $b = $a; $b->foo = 42; echo $a->foo;
42, 42
NULL,42
42,NULL
NULL,NULL
Note: This Question is unanswered, help us to find answer for this one
Check Answer
140.
Which of the following is the correct option to get a numerically indexed array containing all defined timezone identifiers in PHP?
$array=DateTimeZone::listIdentifiers(DateTimeZone::UTC);
$array=DateTimeZone::listIdentifiers(DateTimeZone:ALL);
$array=DateTimeZone::listIdentifiers(DateTimeZone:UTC);
$array=DateTimeZone::listIdentifiers(DateTimeZone::ALL);
Answer
Correct Answer:
$array=DateTimeZone::listIdentifiers(DateTimeZone:ALL);
Note: This Question is unanswered, help us to find answer for this one
Check Answer
141.
Choose the correct option to force redirect from http to https:
RewriteCond %{HTTPS} on RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
RewriteCond %{HTTP} off RewriteRule (\d|\w|\/\/)* https://%{HTTP_HOST}%{REQUEST_URI}
RewriteCond %{HTTPS} on RewriteRule [\w\W]* https://%{HTTP_HOST}%{REQUEST_URI}
Answer
Correct Answer:
RewriteCond %{HTTPS} on RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
Note: This Question is unanswered, help us to find answer for this one
Check Answer
142.
What will be the output of the following code? $var1='/'; $var2='/&%#!'; echo (strpos($var1, $var2)? 'Found' : 'Not found');
Not found
Found
Syntax error
Function not found
Answer
Correct Answer:
Not found
Note: This Question is unanswered, help us to find answer for this one
Check Answer
143.
What would be the output of the following code? $str = "0011110000bsts11100"; echo trim($str,'010s');
bt
bst
bsts
0011110000bsts11100
Note: This Question is unanswered, help us to find answer for this one
Check Answer
144.
What would be the output of the following code? $parts = parse_url("https://example.com/test/1234?testing&val&id=1&&=23&row=4"); parse_str($parts['query'], $query); echo count($query);
2
3
4
5
Note: This Question is unanswered, help us to find answer for this one
Check Answer
145.
What will be the output of the below code? $tmp ="Dragon%%Ball%%Z%"; $arr = explode('%',trim($tmp)); echo count($arr);
4
3
5
6
Note: This Question is unanswered, help us to find answer for this one
Check Answer
146.
What will be the output of the following code? $arr = array ("THEY", "WE", array ("I", "YOU"), "YOUR"); echo (count($arr, 1));
3
4
5
6
Note: This Question is unanswered, help us to find answer for this one
Check Answer
147.
Which of the following is not the correct way to create an empty object in PHP?
$obj = (object)[];
$obj = new class();
$obj = new stdClass();
$obj = new \stdClass;
Answer
Correct Answer:
$obj = new class();
Note: This Question is unanswered, help us to find answer for this one
Check Answer
148.
Which expression would return true?
$c="a" !== " ";
$c="a" !== "a";
$c="a" ==! " ";
$c="a" ==! "a";
Answer
Correct Answer:
$c="a" !== " ";
Note: This Question is unanswered, help us to find answer for this one
Check Answer
149.
Which method is used to tweak an object’s cloning behavior?
clone()
__clone()
_clone
object_clone()
Answer
Correct Answer:
__clone()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
150.
What will be the output of the following code? echo (1234 == '1234 test' ? 'Equal' : 'Not equal' );
Not equal
Equal
None
Error
Note: This Question is unanswered, help us to find answer for this one
Check Answer
151.
How do you access result set meta data?
?php $mysqli = new mysqli("abcs.com", "user", "password", "database"); if ($mysqli->connect_errno) { echo "Failed to connect to MySQL: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error; } $res = $mysqli->query("SELECT 1 AS _one, 'Hello' AS _two FROM DUAL"); var_dump(.$res->fetch_fields(1)); ?>
connect_errno) { echo "Failed to connect to MySQL: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error; } $res = $mysqli->query("SELECT 1 AS _one, 'Hello' AS _two FROM DUAL"); var_dump($res->fetch_fields()); ?>
connect_errno) { echo "Failed to connect to MySQL: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error; } $res = $mysqli->query("SELECT 1 AS , 'Hello' AS _two FROM DUAL"); var_dump(res->$fetch_fields()); ?>
connect_errno) { echo "Failed to connect to MySQL: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error; } $res = $mysqli->query("SELECT 1 AS _one, 'Hello' AS _two FROM DUAL"); var_dump(res->.fetch_fields(0)); ?>
Answer
Correct Answer:
connect_errno) { echo "Failed to connect to MySQL: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error; } $res = $mysqli->query("SELECT 1 AS _one, 'Hello' AS _two FROM DUAL"); var_dump($res->fetch_fields()); ?>
Note: This Question is unanswered, help us to find answer for this one
Check Answer
152.
Xdebug is a PHP __________, the information which Xdebug provides is about stack and functions with full parameter for user defined functions, memory allocation and support for infinite recursions.
Framework
Library
Extension
Class
Answer
Correct Answer:
Extension
Note: This Question is unanswered, help us to find answer for this one
Check Answer
153.
What will be the output of the following PHP code? array ("min_range"=>0, "max_range"=>256)); if (!filter_var($var, FILTER_VALIDATE_INT, $int_options)) echo("Integer is not valid"); else echo("Integer is valid"); ?>
No output is returned
Integer is not valid
Integer is valid
Error
Answer
Correct Answer:
Integer is not valid
Note: This Question is unanswered, help us to find answer for this one
Check Answer
154.
Which of the following functions are provided in the mysqlnd plugin API? (choose all that apply)
mysqlnd_plugin_get_count()
mysqlnd_plugin_get_plugin_connection_data()
mysqlnd_plugin_get_plugin_protocol_data()
mysqlnd_send_meta_get_methods()
mysqlnd_protocol_get_methods()
Answer
Correct Answer:
mysqlnd_plugin_get_plugin_connection_data() mysqlnd_plugin_get_plugin_protocol_data() mysqlnd_protocol_get_methods()
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Check Answer
155.
What is the output of the following code? class Foo { private $foo; protected $bar; public $test; public function __construct() { $this->foo = 1; $this->bar = 2; $this->test = 3; } } print_r( (array) new Foo );
Array ( [foo] => 1 [bar] => 2 [test] => 3 )
Array ( [Foofoo] => 1 [*bar] => 2 [test] => 3 )
Array ( [Foo] => 1 [*bar] => 2 [test] => 3 )
Array ( [Foofoo] => 1 [bar] => 2 [test] => 3 )
Answer
Correct Answer:
Array ( [Foofoo] => 1 [*bar] => 2 [test] => 3 )
Note: This Question is unanswered, help us to find answer for this one
Check Answer
156.
Which of the following are valid MySQLi Configuration Options? (choose all that apply)
mysqli.allow_persistent
mysqli.rollback_on_cached_size
mysqli.default_port
mysqli.default_socket
Answer
Correct Answer:
mysqli.allow_persistent mysqli.default_port mysqli.default_socket
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Check Answer
157.
What will be the output of following code? <?php $i = 016; echo $i / 2; ?>
7
8
016
Fatal Error
Note: This Question is unanswered, help us to find answer for this one
Check Answer
158.
What will the output of following code:- <?php class BaseClass { public function test() { echo "BaseClass::test() called\n"; } final public function moreTesting() { echo "BaseClass::moreTesting() called\n"; } } class ChildClass extends BaseClass { public function moreTesting() { echo "ChildClass::moreTesting() called\n"; } } $obj=new ChildClass; $obj->moreTesting(); ?>
ChildClass::moreTesting() called
Results in Fatal error: Cannot override final method BaseClass::moreTesting()
BaseClass::moreTesting() called
BaseClass::moreTesting() called ChildClass::moreTesting() called
Answer
Correct Answer:
Results in Fatal error: Cannot override final method BaseClass::moreTesting()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
159.
Which magic method is used to implement overloading in PHP?
__call
__invoke
__wakeup
__unset
Note: This Question is unanswered, help us to find answer for this one
Check Answer
160.
What will be the output of following code:- <?php class A { public static function foo() { static::who(); } public static function who() { echo __CLASS__."\n"; } } class B extends A { public static function test() { A::foo(); parent::foo(); self::foo(); } public static function who() { echo __CLASS__."\n"; } } class C extends B { public static function who() { echo __CLASS__."\n"; } } C::test(); ?>
A C C
A A A
C C A
C A C
Note: This Question is unanswered, help us to find answer for this one
Check Answer
161.
Which of the following code can be used to send email to multiple recipients?
$recipients = array('recipient1@domain.com', 'recipient2@domain.com); mail($recipients, $subject, $message, $headers);
$recipients = array('recipient1@domain.com', 'recipient2@domain.com); mail(implode(',', $recipients), $subject, $message, $headers);
$recipients = array('recipient1@domain.com', 'recipient2@domain.com); mail(implode(',', $recipients), $message,$subject, $headers);
All of the above
Answer
Correct Answer:
$recipients = array('recipient1@domain.com', 'recipient2@domain.com); mail(implode(',', $recipients), $subject, $message, $headers);
Note: This Question is unanswered, help us to find answer for this one
Check Answer
162.
What is the procedural style of associative array?
$row = mysqli_fetch_array($result, MYSQLI_NUM);
printf (“%s (%s)/n”, $row[0], $row[1],);
$row = mysqli_fetch_array($result, MYSQLI_BOTH);
printf (“%s (%s)/n”, $row[0], $row[“CountryCode”],);
$row = mysqli_fetch_array($result, MYSQLI_ASSOC);
printf (“%s (%s)/n”, $row[“Name”], $row[“CountryCode”],);
$row = mysqli_fetch_array($result, MYSQLI_ASSOC);
printf (“%s (%s)/n”, $row[“Name”], $row[0],);
Answer
Correct Answer:
$row = mysqli_fetch_array($result, MYSQLI_ASSOC);
printf (“%s (%s)/n”, $row[“Name”], $row[“CountryCode”],);
Note: This Question is unanswered, help us to find answer for this one
Check Answer
163.
What is the Object oriented style of associative array?
$row = $result->fetch_array(MYSQLI_BOTH); printf ("%s (%s)\n", $row[0], $row["CountryCode"]);
$row = $result->fetch_array(MYSQLI_ASSOC); printf ("%s (%s)\n", $row["Name"], $row["CountryCode"]);
$row = $result->fetch_array(MYSQLI_BOTH); printf ("%s (%s)\n", .row[1], $row["CountryCode"]);
$row = $result->fetch_array(MYSQLI_NUM); printf ("%s (%s)\n", $row[0], $row[1]);
Answer
Correct Answer:
$row = $result->fetch_array(MYSQLI_ASSOC); printf ("%s (%s)\n", $row["Name"], $row["CountryCode"]);
Note: This Question is unanswered, help us to find answer for this one
Check Answer
164.
What are the main PHP API offerings for using MYSQL?
PHP Data Objects (PDO)
PHP’s mysqli Extention
PHP’s MYSQL Extention
All of the above
Answer
Correct Answer:
All of the above
Note: This Question is unanswered, help us to find answer for this one
Check Answer
165.
There are a number of mysqlnd plugins already available. These include: (choose all that apply)
PECL/mysqlnd_pscache - Prepared Statement Handle Cache plugin
PECL/mysqlnd_sip - SQL Injection Protection plugin
PECL/mysqlnd_dc - Data Connect plugin
PECL/mysqlnd_uh - User Handler plugin
PECL/mysqlnd_qc - Query Cache plugin
Answer
Correct Answer:
PECL/mysqlnd_pscache - Prepared Statement Handle Cache plugin PECL/mysqlnd_sip - SQL Injection Protection plugin PECL/mysqlnd_uh - User Handler plugin PECL/mysqlnd_qc - Query Cache plugin
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Check Answer
166.
What are the different forms of Polymorphism?
Function overloading
Operator overloading
Both of the above
None of the above
Answer
Correct Answer:
Operator overloading
Note: This Question is unanswered, help us to find answer for this one
Check Answer
167.
When Designing Classes with UML, a class at its core has the following components? (choose all that apply)
Constructor
Public
Private
Methods
Attributes
Answer
Correct Answer:
Constructor Methods Attributes
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Check Answer
168.
What are the two forms of Polymorphsim?
A) function overloading
B) operator overloading
C) method overloading
D) A & B
E) B & C
Note: This Question is unanswered, help us to find answer for this one
Check Answer
169.
What is the output when the following code is executed? <?php function myFun($a) { if (!$a) { throw new Exception('Value init.'); } return 3/$a; } try { echo myFun(3) . "\n"; } catch (Exception $e) { echo 'Caught exception: ', $e->getMessage(), "\n"; } finally { echo "first\n"; } try { echo myFun(1) . "\n"; } catch (Exception $e) { echo 'Caught exception: ', $e->getMessage(), "\n"; } finally { echo "second\n"; } echo "Hello PHP Example\n"; ?>
Value init.3 first 1 second Hello PHP Example
Value init.1 first 3 second Hello PHP Example
1 first 3 second Hello PHP Example
Value init.1 first 5 second Hello PHP Example
Answer
Correct Answer:
1 first 3 second Hello PHP Example
Note: This Question is unanswered, help us to find answer for this one
Check Answer
170.
The following mysqlnd C API calls are monitored by the plugin to check for which transient errors? (choose all that apply)
change_user(),
set_autocomplete(),
set_server_option()
set_autobegint(),
tx_commit_or_rollback().
Answer
Correct Answer:
change_user(), set_server_option() tx_commit_or_rollback().
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Check Answer
171.
The global transaction is either ended by calling __ or by __ in case of an error?
mysqlnd_ms_xa_commit, mysqli_ms_xa_callback
mysqlnd_ms_xa_autocommit, mysqlnd_ms_xa_rollback
mysqlnd_ms_xa_commit, mysqlnd_ms_xa_rollback
mysqli_ms_xa_commit, mysqlnd_ms_xa_rollback
Answer
Correct Answer:
mysqlnd_ms_xa_commit, mysqlnd_ms_xa_rollback
Note: This Question is unanswered, help us to find answer for this one
Check Answer
172.
How can you switch connection to appropriate shard and insert record of the manual partition?
mysqlnd_ms_fabric_select_global($mysqli, “test.fabrictest”);
if ( !$mysqli->query(“CREATE TABLE test.fabrictest(id INT NOT NULL PRIMARY KEY)” )) {
die(sprintf(“[%d] %s\n” , $mysqli->errno, $mysqli->error));
}
mysqlnd_ms_fabric_select_shard($mysqli, “test.fabrictest”, 10);
if ( !$res = $mysqli->query(“SELECT id FROM test WHERE id = 10”))) {
die(sprintf(“[%d] %s\n” , $mysqli->errno, $mysqli->error));
}
mysqlnd_ms_fabric_select_shard($mysqli, “test.fabrictest”, 10);
if ( !$res = $mysqli->query(“INSERT INTO fabrictest (id) VALUES (10)”))) {
die(sprintf(“[%d] %s\n” , $mysqli->errno, $mysqli->error));
}
mysqlnd_ms_fabric_select_shard($mysqli, “test.fabrictest”, 10);
if ( !$res = $mysqli->query(“INSERT INTO fabrictest (id) VALUES (10)”))) {
die(sprintf(“[$d] %s\n” , .mysqli->errno, $mysqli->error));
}
Answer
Correct Answer:
mysqlnd_ms_fabric_select_shard($mysqli, “test.fabrictest”, 10);
if ( !$res = $mysqli->query(“INSERT INTO fabrictest (id) VALUES (10)”))) {
die(sprintf(“[%d] %s\n” , $mysqli->errno, $mysqli->error));
}
Note: This Question is unanswered, help us to find answer for this one
Check Answer
173.
You can apply the following commands for mysqlnd or libmysqlclient configuration?
$ ./configure --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-mysql=mysqlnd
./configure --with-mysqli=/path/to/mysql_config --with-pdo-mysql=/path/to/mysql_config --with-ma-mas
$ ./configure --with->mysqli=mysqlnd ->with-pdo-mysql=mysqlnd --with-mysql=mysqlilnd
$ ./configure --with-mysqli --with-pdo-mysql --with-mysql
Answer
Correct Answer:
$ ./configure --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-mysql=mysqlnd $ ./configure --with-mysqli --with-pdo-mysql --with-mysql
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Check Answer
174.
Which is a callback function or object method taking the following parameters?
&buffer
&errormsg
buflen
stream
All of the above
Answer
Correct Answer:
All of the above
Note: This Question is unanswered, help us to find answer for this one
Check Answer
175.
The PDO_MYSQL Data Source Name (DSN) is composed of the following elements?
user_pass
db_table
dbname
unix_socket
charset
Answer
Correct Answer:
dbname unix_socket charset
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Check Answer
176.
What is the output when the following code is executed? function callFun( &$arg ) { $return = $arg; $arg += 1; return $return; } $a = 3; $b = callFun( $a ); $c = callFun($a); echo $a; echo ' \n '; echo $b; echo ' \n '; echo $c;
1 \n 3 \n 4
3 \n 4 \n 4
5 \n 3 \n 4
4 \n 3 \n 5
Answer
Correct Answer:
5 \n 3 \n 4
Note: This Question is unanswered, help us to find answer for this one
Check Answer
177.
What are the short explanations of the configuration directives? (choose all that apply)
mysqli.allow_persistent
mysqli.rollback_on_cached_size
mysqli.default_port
mysqli.default_socket
Answer
Correct Answer:
mysqli.allow_persistent
Note: This Question is unanswered, help us to find answer for this one
Check Answer
178.
When connecting to a MySQL database server, what are the main API options? (choose all that apply)
PHP Data Objects (PDO)
PHP's mysqlis Extension
PHP's MySQL Extension
All of the above
Answer
Correct Answer:
PHP Data Objects (PDO) PHP's MySQL Extension
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Check Answer
179.
How you can send Multiple email recipients all go into the address field, with commas separating?
$headers = "From:sender@example.com\r\n"; $recipients = "abc@hotmail.com,xyz@gmail.com"; mail($recipients, "This is the subject","This is the mail body", $headers);
$mailsend = mail("receiver@receipthost, abc@hotmail.com, xyz@gmail.com", "The Sample Subjects Here", "Body of e-mail."); print("$mailsend");
$address = "abc@hotmail.com"; $Subject = "I want a Car"; $body = "Smith"; $mailsend = mail("$address", "$Subject", "$body."); print("$mailsend");
All of the above
Answer
Correct Answer:
$mailsend = mail("receiver@receipthost, abc@hotmail.com, xyz@gmail.com", "The Sample Subjects Here", "Body of e-mail."); print("$mailsend");
Note: This Question is unanswered, help us to find answer for this one
Check Answer
180.
What is a type of PHP error severity? (choose all that apply)
Errors (E_ERROR)
Stri dynamic problems (E_STRI)
Notices (E_NOTICE)
Warnings (E_WARNING)
All of the above
Answer
Correct Answer:
Errors (E_ERROR)
Note: This Question is unanswered, help us to find answer for this one
Check Answer
181.
Which function can be used to determine if a file exists? (choose all that apply)
is_readable()
file_exists()
feof()
is_file_exists()
Answer
Correct Answer:
is_readable()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
182.
After the following query is executed using PHP, which function can be used to count the number of rows returned? (choose any that apply)
mysqli_affected_rows()
mysqli_num_rows()
mysqli_use_result()
mysqli_fetch_lengths()
Answer
Correct Answer:
mysqli_affected_rows()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
183.
Advantages of PHP-GTK include the following? (choose all that apply)
Cross-platform
Officially supported PHP project
GTK+ doesn’t look native on all platforms; the look and feel of GTK/apps is most at home on Linux-type OSs
Provides direct binding to the GTK+ toolkit
Answer
Correct Answer:
Cross-platform Officially supported PHP project Provides direct binding to the GTK+ toolkit
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Check Answer
184.
What are the Scope of variables? (choose all that apply)
Dynamic
Static
Parameter
Global
All of the above
Answer
Correct Answer:
Static Parameter Global
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Check Answer
185.
What are the Server object Methods?
$_SERVER['REMOTE_PORT']
$_SERVER['DOCUMENT_ROOT']
$_SERVER['DOCUMENT_ROOT']
$_SERVER['DOCUMENT_OBJ']
Answer
Correct Answer:
$_SERVER['REMOTE_PORT'] $_SERVER['DOCUMENT_ROOT'] $_SERVER['DOCUMENT_ROOT']
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Check Answer
186.
Capturing Logging - Use these and send output to $logger as follows?
register_shutdown_function()
set_exception_handler()
set_error_handler()
set_session_handler()
Answer
Correct Answer:
register_shutdown_function() set_exception_handler() set_error_handler()
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Check Answer
187.
Starting External Processes from PHP/Shelling Out there are numerous functions available in PHP to achieve this. Which one applies?
system(): Executes a program in the current process space
exec(): Executes a program and sends the text output to the user
proc_open(): Like popen(), but with more control. Allows both reading and writing at the same time
passthru(): Executes a command and shell the binary output to the user
Answer
Correct Answer:
exec(): Executes a program and sends the text output to the user proc_open(): Like popen(), but with more control. Allows both reading and writing at the same time passthru(): Executes a command and shell the binary output to the user
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Check Answer
188.
Which MIME type needs to be used to send attachment in mail?
text/html
text/plain
application/mixed
multipart/mixed
Answer
Correct Answer:
multipart/mixed
Note: This Question is unanswered, help us to find answer for this one
Check Answer
189.
what will be the output of the program if the value of ‘cate’ remains 5?
1. <?php
2. $cate=5;
3. …
4. …
5. If ($cate==5)
6. {
7. ?>
8. Correct category!
9. <?php
10. } else {
11. ?>
12. Incorrect category!
13. <?php
14. }
15. ?>
Correct category!
Incorrect category!
Error due to use of invalid operator in line 6:”if ($cate==5)”
Error due to incorrect syntax at line 8, 10, 12 and 14
Answer
Correct Answer:
Error due to use of invalid operator in line 6:”if ($cate==5)”
Note: This Question is unanswered, help us to find answer for this one
Check Answer
190.
What does array_pop($array) do?
Return all the values in $array.
Returns the last value in $array and removes it from the array.
Adds values onto the end of $array.
Returns a string containing a randomly selected key from $array.
Answer
Correct Answer:
Returns the last value in $array and removes it from the array.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
191.
<?php $colors = array("red", "green", "blue", "yellow"); foreach ($colors as $value) { echo "$value "; } ?> What will be the output of this PHP code?
red green blue yellow
red
yellow
no output
Answer
Correct Answer:
red green blue yellow
Note: This Question is unanswered, help us to find answer for this one
Check Answer
192.
Following functions identify the presence of a substring and its position in a larger string?
stristr
strips
stripos
strchr
strstc
Answer
Correct Answer:
stristr strips stripos strchr strstc
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Check Answer
193.
The hash array contains the various attributes of the XML-RPC call as an associative array as follows?
Array of arguments to the method
Hostname of the web service offering the method
URL path to the server file
Associative array of options, as for the server
Answer
Correct Answer:
Array of arguments to the method Hostname of the web service offering the method URL path to the server file Associative array of options, as for the server
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Check Answer
194.
PHP enables to set a default error handler using the set_error_handler() function and include the following parameters will be passed to the user-defined error handler function?
array $errcontext [optional]
integer $errline [optional]
string $errfile [optional]
string $errno
Answer
Correct Answer:
integer $errline [optional] string $errfile [optional] string $errno
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Check Answer
195.
Following functions change the format of a string, according to a series of special characters?
vsprintf
sprintf
preg_filter
money_format
explode
Answer
Correct Answer:
vsprintf sprintf preg_filter
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Check Answer
196.
Which of the following are Vaild variable names in PHP?
$~yy
$yy-yy
$1
None of the above
Answer
Correct Answer:
None of the above
Note: This Question is unanswered, help us to find answer for this one
Check Answer
197.
Which of the following code snippet is True for Convert JSON string to Object?
<? $jsonvar = '[{"name":"Jhon","gender":"male"}]'; $jsonobj = json_decode($jsonvar); print_r($jsonobj); echo $jsonobj[0]->name; ?>
<? $jsonvar = '[{"name":"Jhon","gender":"male"}]'; $jsonobj = json_decode($jsonvar); print_r(jsonobj); echo $jsonobj[0].$name; ?>
<? $jsonvar = ["name":"Jhon","gender":"male"]; $jsonobj = json_decode(jsonvar); print_r($jsonobj); echo $jsonobj[0]->name; ?>
<? $jsonvar = '[{"name":"Jhon","gender":"male"}]'; $jsonobj = json_decode(jsonvar); print_r(jsonobj); echo $jsonobj[0].name; ?>
Answer
Correct Answer:
<? $jsonvar = '[{"name":"Jhon","gender":"male"}]'; $jsonobj = json_decode($jsonvar); print_r($jsonobj); echo $jsonobj[0]->name; ?>
Note: This Question is unanswered, help us to find answer for this one
Check Answer
198.
Which of the following code snippet is True for Convert JSON string to Array?
<? $jsonvar = '[{"name":"Jhon","gender":"male"}]'; $jsonobj = json_decode($someJSON); print_r($jsonobj); echo $jsonobj[0].$name; ?>
<? $jsonvar = '["name":"Jhon","gender":"male"]'; $jsonarray = json_decode(jsonvar, true); print_r($jsonarray); echo $jsonarray[0][$name]; ?>
<? $jsonvar = '[{"name":"Jhon","gender":"male"}]'; $jsonarray = json_decode($jsonvar, true); print_r($jsonarray); echo $jsonarray[0]["name"]; ?>
<? $jsonvar = '["name":"Jhon","gender":"male"]'; $jsonobj = json_decode($someJSON); print_r($jsonobj); echo $jsonobj[0].$name; ?>
Answer
Correct Answer:
<? $jsonvar = '[{"name":"Jhon","gender":"male"}]'; $jsonarray = json_decode($jsonvar, true); print_r($jsonarray); echo $jsonarray[0]["name"]; ?>
Note: This Question is unanswered, help us to find answer for this one
Check Answer
199.
Which of the following query grabs the Top 10 scores from database, sorting by score and timestamp?
<?php require ('connectToDatabase.php'); $query = "SELECT FROM userdata ORDER by `score` LIMIT 10"; $result = $connquery(sql); if ($result->num_rows > 0) { while($row = $result->fetch_assoc()) { echo "id: " . $row["id"]. " - Name: " . $row["firstname"]. " " . $row["lastname"]. "<br>"; } } else { echo "<div>No records found.</div>"; } $conn->close(); ?>
<?php require ('connectToDatabase.php'); $query = "SELECT * FROM `userdata` ORDER by score ASC 10"; $result = $conn->query(sql); if ($result-> 0) { while($row = $result->fetch_assoc()) { echo "id: " . $row["id"]. " - Name: " . $row["firstname"]. " " . $row["lastname"]. "<br>"; } } else { echo "<div>No records found.</div>"; } $conn->close(); ?>
<?php require ('connectToDatabase.php'); $query = "SELECT * FROM `userdata` ORDER by `score` ASC LIMIT 10"; $result = $conn->query($sql); if ($result->num_rows > 0) { while($row = $result->fetch_assoc()) { echo "id: " . $row["id"]. " - Name: " . $row["firstname"]. " " . $row["lastname"]. "<br>"; } } else { echo "<div>No records found.</div>"; } $conn->close(); ?>
<?php require ('connectToDatabase.php'); $query = "SELECT * FROM userdata ORDER by `score` ASC 10"; $result = $conn->query($sql); if ($result->num_rows > result.length) { while($row = $result->fetch_assoc()) { echo "id: " . $row["id"]. " - Name: " . $row["firstname"]. " " . $row["lastname"]. "<br>"; } } else { echo "<div>No records found.</div>"; } $conn->close(); ?>
Answer
Correct Answer:
<?php require ('connectToDatabase.php'); $query = "SELECT * FROM `userdata` ORDER by `score` ASC LIMIT 10"; $result = $conn->query($sql); if ($result->num_rows > 0) { while($row = $result->fetch_assoc()) { echo "id: " . $row["id"]. " - Name: " . $row["firstname"]. " " . $row["lastname"]. "<br>"; } } else { echo "<div>No records found.</div>"; } $conn->close(); ?>
Note: This Question is unanswered, help us to find answer for this one
Check Answer
200.
Which of the following type cast is not correct? <?php $fig = 23; $varbl = (real) $fig; $varb2 = (double) $fig; $varb3 = (decimal) $fig; $varb4 = (bool) $fig; ?>
real
double
decimal
boolean
Note: This Question is unanswered, help us to find answer for this one
Check Answer
201.
What will be the output of the following code? function fn(&$var) { $var = $var - ($var/10 * 5); return $var; } echo fn(100);
100
50
98
Error message
None of these
Answer
Correct Answer:
Error message
Note: This Question is unanswered, help us to find answer for this one
Check Answer
202.
What will be the output of the following code? $var = 10; function fn() { $var = 20; return $var; } fn(); echo $var;
10
20
Undefined Variable
Syntax Error
Note: This Question is unanswered, help us to find answer for this one
Check Answer
203.
<?php
$favcolor = “green”;
switch ($favcolor) {
case “red”:
echo “Your favorite color is red!”;
break;
case “blue”:
echo “Your favorite color is blue!”;
break;
case “green”:
echo “Your favorite color is green!”;
break;
default:
echo “Your favorite color is neither red, blue, nor green!”;
}
?>
What will be the output of this PHP code?
Your favorite color is red! Your favorite color is blue! Your favorite color is green!
Your favorite color is neither red, blue, nor green!
Your favorite color is green!
No output
Answer
Correct Answer:
Your favorite color is green!
Note: This Question is unanswered, help us to find answer for this one
Check Answer
204.
How to create database with PHP in MySQL server?
create_db(‘database’);
mysql_db(‘database’);
mysql_create_db(‘database’);
mysql_server_create_db(‘database’);
Answer
Correct Answer:
mysql_create_db(‘database’);
Note: This Question is unanswered, help us to find answer for this one
Check Answer
205.
What is the syntax of a class in PHP?
class ClassName { // Class properties and methods go here }
ClassName class { // Class properties and methods go here }
class ClassName = function() { // Class properties and methods go here }
class ClassName ({ // Class properties and methods go here })
Answer
Correct Answer:
class ClassName { // Class properties and methods go here }
Note: This Question is unanswered, help us to find answer for this one
Check Answer
206.
How to connect with MySQL server in PHP?
database_connect(server, username, password)
mysql_connect(host, username, password)
mysql(server, username, password)
connect(server, username, password)
Answer
Correct Answer:
mysql_connect(host, username, password)
Note: This Question is unanswered, help us to find answer for this one
Check Answer
207.
What is the correct syntax of constructor function?
function construct($var, $var2){ //code }
_construct($var1, $var2){ //code}
function _construct($var1, $var2){ //code }
function constructor($var1, $var2){ //code }
Answer
Correct Answer:
function _construct($var1, $var2){ //code }
Note: This Question is unanswered, help us to find answer for this one
Check Answer
208.
How to remove whitespace from the beginning and end of $string variable?
cut($string);
removespace($string);
shorten($string);
trim($string);
Answer
Correct Answer:
trim($string);
Note: This Question is unanswered, help us to find answer for this one
Check Answer
209.
How to drop a database in MySQL server?
mysql_drop_db(‘database’);
drop_db(‘database’);
mysql_drop(‘database’);
mysql(‘database’) drop;
Answer
Correct Answer:
mysql_drop_db(‘database’);
Note: This Question is unanswered, help us to find answer for this one
Check Answer
210.
<?php
$string = ‘I wish I had 3three some capitalization’;
Echo ucwords($string);
?>
What will be the output of above code?
I wish i had 3three some capitalization
i wish i had 3three some capitalization
I Wish I Had 3three Some Capitalization
No output
Answer
Correct Answer:
I Wish I Had 3three Some Capitalization
Note: This Question is unanswered, help us to find answer for this one
Check Answer
211.
<?php
$arr = array(‘Hello’, ‘World!’, ‘Beautiful’, ‘Day!’);
Echo implode(“ ”, $arr);
?>
What will be the output of above code?
HelloWorld!BeautifulDay!
‘Hello’, ‘World!’, ‘Beautiful’, ‘Day!’
Hello World! Beautiful Day!
No output
Answer
Correct Answer:
Hello World! Beautiful Day!
Note: This Question is unanswered, help us to find answer for this one
Check Answer
212.
PHP provides a range of ways to manipulate directories, including the following functions?
dirname() Returns the directory portion of a path
rewindir() Back the directory pointer back to the start of the list of entries
chdir() Changes the current directory
rmdir() Deletes a directory
Answer
Correct Answer:
dirname() Returns the directory portion of a path chdir() Changes the current directory rmdir() Deletes a directory
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Check Answer
213.
PHP has functions to set, move, and reset this iterator and the iterator functions are?
each( ) Returns the element to the last element in the array
current( ) Returns the element currently pointed at by the iterator
reset( ) Moves the iterator to the first element in the array and returns it
end( ) Moves the iterator to the next element in the array and returns it
key( ) Returns the key of the current element
Answer
Correct Answer:
current( ) Returns the element currently pointed at by the iterator reset( ) Moves the iterator to the first element in the array and returns it key( ) Returns the key of the current element
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Check Answer
214.
The ereg( ) function takes a pattern, a ____ , and an optional array?
constructer
class
variable
boolean
string
Note: This Question is unanswered, help us to find answer for this one
Check Answer
215.
How to approach static methods and properties, please choose correct answer? class Utilis { static public $numstudent = 0;
Utilis::$numstudent = 3;
echo $Utilis -> set(numstudent);
echo $Utilis -> get(numstudent);
echo Utilis::$numstudent;
echo $Utilis -> numstudent;
Answer
Correct Answer:
Utilis::$numstudent = 3; echo Utilis::$numstudent;
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Check Answer
216.
There are following categories of functions for POSIX-style regular expressions?
matching
replacing
splitting
None of the above
Answer
Correct Answer:
matching replacing splitting
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Check Answer
217.
Which of the following code syntax is True about declaring a class definition?
class Myclassname [ extends baseclass ] { [ var $property [ = value ]; ... ] [ function functionname (args) { // code } ... ] }
class Myclassname ( extends baseclass ) { var $property = value ; ... [ function functionname (args) { // code } ... ] }
class Myclassname { (extends baseclass ) { var $property ( = value ); ... function functionname (args) { // code } ... ] }
class Myclassname [ extends baseclass ] { var $property = value ; ... ] } function functionname (args) { // code )} ... ] }
Answer
Correct Answer:
class Myclassname [ extends baseclass ] { [ var $property [ = value ]; ... ] [ function functionname (args) { // code } ... ] }
Note: This Question is unanswered, help us to find answer for this one
Check Answer
218.
The following functions can be used from Exception class?
getLine()
getCodeByName()
getMessage()
getid()
getTraceAsString()
Answer
Correct Answer:
getLine() getMessage() getTraceAsString()
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Check Answer
219.
To set PDO to raise exceptions, Database errors occur you can use the PDO::SetAttribute method to set your PDO object’s error mode as follows?
$conn = new PDO( $dsn, $username, $password ); $conn->setAttribute( PDOATTR_ERRMODE, PDOERRMODE_EXCEPTION );
$conn = new PDO( $dsn, $username, $password ); $conn.setAttribute( PDO:ATTR_ERRMODE, PDO:ERRMODE_EXCEPTION );
$conn = new PDO( $dsn, $username, $password ); $conn->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );
None of the above
Answer
Correct Answer:
$conn = new PDO( $dsn, $username, $password ); $conn->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );
Note: This Question is unanswered, help us to find answer for this one
Check Answer
220.
Which of the following methods perform aggregate functions on all items in an array?
array_sum
array_uniq
array_rand
array_product
array_pro
Answer
Correct Answer:
array_sum
Note: This Question is unanswered, help us to find answer for this one
Check Answer
221.
PHP currently offers following functions for searching strings using POSIX-style regular expressions?
sql_regcase()
eragi_replace()
ereg_replace()
spliti()
erag()
Answer
Correct Answer:
sql_regcase() ereg_replace() spliti()
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Check Answer
222.
PHP represents regular expressions as strings there are following different set of functions?
preg_split
explode
preg_patern
str_replace
preg_filter
Answer
Correct Answer:
preg_split
Note: This Question is unanswered, help us to find answer for this one
Check Answer
223.
PHP Errors, There are following type levels of error severity to start with?
Errors (E_ERROR)
Stri dynamic problems (E_STRI)
Notices (E_NOTICE)
Warnings (E_WARNING)
All of the above
Answer
Correct Answer:
Errors (E_ERROR) Notices (E_NOTICE) Warnings (E_WARNING)
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Check Answer
224.
Which of the following is not supported in PHP?
Type Hinting
Reflection
Magic Methods
Multiple Inheritance
Object Cloning
Answer
Correct Answer:
Multiple Inheritance
Note: This Question is unanswered, help us to find answer for this one
Check Answer
225.
Which of the following syntax is not correct to embed PHP?
?php PHP CODE HERE ?>
<? PHP CODE HERE ?>
<php PHP CODE HERE >
Answer
Correct Answer:
<php PHP CODE HERE >
Note: This Question is unanswered, help us to find answer for this one
Check Answer
226.
What is the output of the following code run using PHP 5.6.0 or higher? const ONE = 1; class foo { const TWO = ONE * 2; const THREE = ONE + self::TWO; const SENTENCE = 'The value of THREE is '.self::THREE; } echo foo::SENTENCE . "\n";
The value of THREE is 1
The value of THREE is 12
The value of THREE is 3
The value of THREE is 13
Answer
Correct Answer:
The value of THREE is 3
Note: This Question is unanswered, help us to find answer for this one
Check Answer
227.
Which of the following will return true keeping in view the following code? function validateDate($date, $format = 'Y-m-d H:i:s') { $d = DateTime::createFromFormat($format, $date); return $d && $d->format($format) == $date; }
validateDate('2012-02-30 12:12:12')
validateDate('30/02/2012', 'd/m/Y')
validateDate('14:77', 'H:i')
validateDate('2012-02-28 12:12:12')
Answer
Correct Answer:
validateDate('2012-02-28 12:12:12')
Note: This Question is unanswered, help us to find answer for this one
Check Answer
228.
Which function is used to get the number of arguments passed to the function?
func_num_args()
$_GET
func_get_args_num()
func_get_arg()
Answer
Correct Answer:
func_num_args()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
229.
Which operator is used to check if two values are equal and of same data type?
=
==
===
!=
Note: This Question is unanswered, help us to find answer for this one
Check Answer
230.
Which of the following type of variables are instances of programmer-defined classes?
Strings
Arrays
Objects
Resources
Note: This Question is unanswered, help us to find answer for this one
Check Answer
231.
What is the output of the following code? session_start(); $_SESSION['logged_in'] = true; $_SESSION['name'] = 'Jane'; $_SESSION['level'] = 4; echo session_encode();
logged_in|b:1;name|s:4:"Jane";level|i:4;
Array ( [logged_in] => 1 [name] => Jane [level] => 4
{"logged_in":true,"name":"Jane","level":4}
You cannot encode session variables.
Answer
Correct Answer:
logged_in|b:1;name|s:4:"Jane";level|i:4;
Note: This Question is unanswered, help us to find answer for this one
Check Answer
232.
How many elements are in the array created by the following line of code: $array = array (true => '5', 1 => '6');
1
2
3
4
Note: This Question is unanswered, help us to find answer for this one
Check Answer
233.
What is the output of the following code? $a = "b"; $b = 22; echo $$a + 40;
22
40
62
0
Note: This Question is unanswered, help us to find answer for this one
Check Answer
234.
What is the output of the following code? try { $a = 10/0; echo $a; } catch (Exception $e) { echo 'You cannot divide by ZERO!!'; }
You cannot divide by ZERO!!
10
Warning: Division by zero
0
Answer
Correct Answer:
Warning: Division by zero
Note: This Question is unanswered, help us to find answer for this one
Check Answer
235.
Which of the following is the correct keyword in SQL?
SELECT
Select
select
SeLeCt
All of the above
Note: This Question is unanswered, help us to find answer for this one
Check Answer
236.
How do you start a session in PHP?
start_session()
session_start()
initiate_session()
session_initiate()
Answer
Correct Answer:
session_start()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
237.
Which of the following is not related with respect to calculating the size of a file?
filesize()
cURL
file_exists()
stat()
Answer
Correct Answer:
file_exists()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
238. Which function can convert a comma separated string into an array using a single call?
strtoarray
explode
extract
substr
Note: This Question is unanswered, help us to find answer for this one
Check Answer
239.
What will be the output of the following code? <?php class FormBuilder { private $elements = array(); public function label($text) { $this->elements[] = "<label>$text</label>"; return $this; } public function input($type, $name, $value = '') { $this->elements[] = "<input type=\"$type\" name=\"$name\" value=\"$value\" />"; return $this; } public function textarea($name, $value = '') { $this->elements[] = "<textarea name=\"$name\">$value</textarea>"; return $this; } public function __toString() { return join("\n", $this->elements); } } $b = new FormBuilder(); echo $b->label('Name')->input('text', 'name')->textarea('message', 'My message');
label>Name/label>
<label>Name</label> <input type="text" name="name"/> <textarea name="message">My message</textarea>
<label>Name</label> <input type="text" name="name" value="" /> <textarea name="message">My message</textarea>
Fatar error on the last line since calling of class methods can not be nested.
Answer
Correct Answer:
<label>Name</label> <input type="text" name="name" value="" /> <textarea name="message">My message</textarea>
Note: This Question is unanswered, help us to find answer for this one
Check Answer
240.
Which of the following function of String object splits a String object into an array of strings by separating the string into substrings?
slice()
split()
replace()
search()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
241.
Which of the following is not a JavaScript datatype?
Function
Boolean
Number
String
Note: This Question is unanswered, help us to find answer for this one
Check Answer
242.
What will the the output of below code? function testfoo() { return { test: 1 }; } alert(typeof testfoo());
function
object
variable
undefined
Note: This Question is unanswered, help us to find answer for this one
Check Answer
243.
Polymorphism is also known as:
Switch
Overact
Encapsulation
Class switching
Answer
Correct Answer:
Class switching
Note: This Question is unanswered, help us to find answer for this one
Check Answer
244.
Which of the following is false with respect to Bridge pattern in PHP?
Bridge is designed up-front to let the abstraction and the implementation vary independently.
Decouple an abstraction from its implementation so that the two can vary independently.
Publish interface in an inheritance hierarchy, and bury implementation in its own inheritance hierarchy.
Use bridge when you do not want to share an implementation among multiple objects.
Answer
Correct Answer:
Use bridge when you do not want to share an implementation among multiple objects.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
245.
Which of the following cannot be used to include a file?
include()
include_once()
require()
insert()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
246.
Which function lets you check that you have reached the end of file while reading the file in PHP?
feof()
f_eof()
end_of_file()
eof()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
247.
Which function is used to read a file removing the HTML and PHP tags in it?
fgetss()
fgets()
fopen()
file_strip_tags()
Answer
Correct Answer:
file_strip_tags()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
248.
Which of the following function is used to get length of a string?
size()
strlen()
length()
None of the above
Note: This Question is unanswered, help us to find answer for this one
Check Answer
249.
Which function is used to delete a file from the server using PHP?
unlink()
unset()
delete()
remove_file()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
250.
mysqli::autocommit does not work with which of the following table types?
InnoDB
BDB
NDB Cluster
MyISAM
Note: This Question is unanswered, help us to find answer for this one
Check Answer
251.
How do you remove the X-Powered-By header?
Setting expose_php = Off in php.ini
Using xss_clean()
Using header()
Setting disable_classes = On in php.ini
Answer
Correct Answer:
Setting expose_php = Off in php.ini
Note: This Question is unanswered, help us to find answer for this one
Check Answer
252.
Which of the following is the correct way to add 1 to the $count variable?
++count;
count++;
$count++;
$count=+1;
Answer
Correct Answer:
$count++;
Note: This Question is unanswered, help us to find answer for this one
Check Answer
253.
How to get client IP address in a PHP script?
$_DOMAIN['REMOTE_ADDR']
$_SERVER['REMOTE_ADDR']
$_SERVER['REMOTE_IP_ADDRESS']
$_ENV
Answer
Correct Answer:
$_SERVER['REMOTE_ADDR']
Note: This Question is unanswered, help us to find answer for this one
Check Answer
254.
Which of the following method of Exception class returns formated string of trace?
getMessage()
getCode()
getTrace()
getTraceAsString()
Answer
Correct Answer:
getTraceAsString()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
255.
What is the output of the following code? $foo = 400; $bar = 10; echo $foo . "+" . $bar;
400+10
410
40010
Error
Nothing will display
Note: This Question is unanswered, help us to find answer for this one
Check Answer
256.
Select the correct statement about setcookie() function:
The setcookie() function must appear after the </html> tag.
The setcookie() function must appear before the <html> tag.
The setcookie() function may appear anywhere in the code.
There is no such function.
Answer
Correct Answer:
The setcookie() function must appear before the <html> tag.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
257.
What will be the output of the following code? <?php $z = 0.5; { $z = 9; echo "My Daily Earnings : $ $z"; } echo "{$z}"; ?>
My Daily Earnings : $ 10
My Daily Earnings : $ 99
My Daily Earnings : $ 50
My Daily Earnings : $ 9
Answer
Correct Answer:
My Daily Earnings : $ 99
Note: This Question is unanswered, help us to find answer for this one
Check Answer
258.
Which of the following is true with respect to Flyweight design pattern in PHP?
All the methods of the class should be private.
This pattern is used when you need only a small number of instances of same type.
Using this pattern consumes a lot of memory.
instances of a class which are identical are shared in an implementation instead of creating a new instance of that class for every instance.
Answer
Correct Answer:
instances of a class which are identical are shared in an implementation instead of creating a new instance of that class for every instance.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
259.
Which superglobal variable holds information about header, paths and script locations?
$_SERVER
$_GLOBALS
$_SESSION
$_GET
Answer
Correct Answer:
$_GLOBALS
Note: This Question is unanswered, help us to find answer for this one
Check Answer
260.
What does ctype_digit() do?
It counts the number of digits in the given string.
It returns TRUE if the string contains only numeric characters.
It returns TRUE if the string contains non-numeric characters.
It returns the numeric characters in a string.
Answer
Correct Answer:
It returns TRUE if the string contains only numeric characters.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
261.
How do you throw an exception in PHP?
throw new Exception(message);
throw Exception(message);
throws new Exception(message);
None of these
Answer
Correct Answer:
throw new Exception(message);
Note: This Question is unanswered, help us to find answer for this one
Check Answer
262.
Which of the following is used to execute a prepared statement in PHP-MySQL?
mysqli_stmt_execute()
mysqli_execute_stmt()
mysqli_query()
mysqli_stmt_bind_param()
Answer
Correct Answer:
mysqli_stmt_bind_param()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
263.
What will be the output of executing the following code? <?php class Foo { private function printName($name) { print_r($name); } } $a = new Foo(); $a->printName('James'); ?>
James
Fatal error: Call to private method Foo::printName() from context ...
Notice: Undefined variable: a
Fatal error: Call to undefined method Foo::printName()
Answer
Correct Answer:
Fatal error: Call to private method Foo::printName() from context ...
Note: This Question is unanswered, help us to find answer for this one
Check Answer
264.
Which of these are not a valid data type?
String
Bool
Char
Integer
UInt
Note: This Question is unanswered, help us to find answer for this one
Check Answer
265.
How do you create a connection to MySQL database in PHP?
mysqliconnect()
mysqli-connect()
mysqli_connect()
sql_connect()
Answer
Correct Answer:
mysqli_connect()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
266.
Which of the following is a valid syntax to create a function?
Function = demoFunction()
function:demoFunction()
function demoFunction()
function create demoFunction()
Answer
Correct Answer:
function demoFunction()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
267.
What is the value of "n1" and "n2" after executing the following code? var str = "Finding foo in Foo and Bar"; var n1 = str.search("Foo"); var n2 = str.search(/Foo/i);
n1 = 15, n2 = 15
n1 = 15, n2 = 8
n1 = 8, n2 = 8
Answer
Correct Answer:
n1 = 15, n2 = 8
Note: This Question is unanswered, help us to find answer for this one
Check Answer
268.
What will be the output of following code? var x = 1; { var x = 2; } alert(x);
1
2
undefined
code will raise an exception
Note: This Question is unanswered, help us to find answer for this one
Check Answer
269.
What will be the output of the following code? $time = strtotime ('2016-01-01'); echo date ('d-m-y H:i:s:u', $time);
16-01-01 00:00:00:00
01-01-16 00:00:00:000000
01-01-2016 00:00:00:000000
01-01-16 00:00:00:00
Answer
Correct Answer:
01-01-16 00:00:00:000000
Note: This Question is unanswered, help us to find answer for this one
Check Answer
270.
What is the correct ways to create an arrays in PHP higher then version 5.3 Note: there may be more then one correct answer
$phones = array("Samsung", "Iphone", "HTC");
$phones = "Samsung", "Iphone", "HTC";
$phones = ["Samsung", "Iphone", "HTC"];
$phones = "Samsung" . "Iphone" . "HTC";
Answer
Correct Answer:
$phones = array("Samsung", "Iphone", "HTC");
Note: This Question is unanswered, help us to find answer for this one
Check Answer
271.
Which of the following are valid in PHP?
$_23
${"foobar"}
&$foo
$23_foobar
$foobar
Note: This Question is unanswered, help us to find answer for this one
Check Answer
272.
What is the output of the following code? $foo = 10; $bar = '10'; if ($foo === $bar){ echo 'I ran'; }
I ran
Nothing is output
TRUE
Error
Note: This Question is unanswered, help us to find answer for this one
Check Answer
273.
Which function in PHP can be used to check if a variable is an array or not?
this_array()
is_array()
do_array()
in_array()
Answer
Correct Answer:
is_array()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
274.
How do you set a particular time zone to be used by your PHP code?
date_default_timezone_set()
set_date_timezone_default()
default_date_timezone_set()
date_timezone_set()
Answer
Correct Answer:
date_default_timezone_set()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
275.
What is the correct way to add 1 to the $a variable?
$a=+1
$a++
++$a
a++
Note: This Question is unanswered, help us to find answer for this one
Check Answer
276.
What does the following statement do with respect to the errors that will get displayed? error_reporting(E_ALL & ~E_NOTICE);
Report all errors
Report only NOTICE messages
Report all errors other than NOTICE messages
Answer
Correct Answer:
Report all errors other than NOTICE messages
Note: This Question is unanswered, help us to find answer for this one
Check Answer
277.
What is the output of the following code? $sentence = "ThiS iS a SenTEnCe"; echo ucwords($sentence);
This Is A Sentence
THIS IS A SENTENCE
this is a sentence
ThiS IS A SenTEnCe
Answer
Correct Answer:
ThiS IS A SenTEnCe
Note: This Question is unanswered, help us to find answer for this one
Check Answer
278.
Which of the following is the correct way to create a function in PHP?
new_function myFunction()
function myFunction()
create myFunction()
new myFunction()
Answer
Correct Answer:
function myFunction()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
279.
Which of the following is the correct way to create an array in PHP?
$animals = array(Cat, Dog, Horse);
$animals = array("Cat", "Dog", "Horse");
$animals = array["Cat", "Dog", "Horse"];
$animals = "Cat", "Dog", "Horse";
Answer
Correct Answer:
$animals = array("Cat", "Dog", "Horse");
Note: This Question is unanswered, help us to find answer for this one
Check Answer
280.
How to get information from a form that is submitted using the "get" method?
Request.Form;
$_GET();
Request.Get;
$_GET[];
Note: This Question is unanswered, help us to find answer for this one
Check Answer
281.
What of the listed below are correct magic methods?
__construct(), __destruct(), __put(), __post()
__construct(), __destruct(), __get(), __set()
__init(), __final(), __get(), __set()
__init(), __final(), __put(), __post()
Answer
Correct Answer:
__construct(), __destruct(), __get(), __set()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
282.
Which of the following magic constant of PHP returns function name?
__LINE__
__FILE__
__FUNCTION__
__CLASS__
Answer
Correct Answer:
__FUNCTION__
Note: This Question is unanswered, help us to find answer for this one
Check Answer
283.
Which of the following has object oriented and procedural support as well as supports prepared statements?
PDO
MYSQLi
MYSQL
Note: This Question is unanswered, help us to find answer for this one
Check Answer
284.
Which of the following is not correct with respect to Authentication using CURL?
CURL can be used to authenticate a user.
CURL can be used to send form data using both GET and POST methods.
CURL can not be used to authenticate a user as it can only be used to access and read webpage data.
CURL can be used for HTTP basic Authentication.
Answer
Correct Answer:
CURL can not be used to authenticate a user as it can only be used to access and read webpage data.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
285.
Which Content Type header need to be set to send an HTML mail in PHP?
‘Content-type: html; charset=iso-8859-1’ . “\r\n”;
‘MIME-Version: 1.0’ . “\r\n”
‘Content-type: text/html; charset=iso-8859-1’ . “\r\n”
‘Content-type: application/html; charset=iso-8859-1’ . “\r\n”’
Answer
Correct Answer:
‘Content-type: text/html; charset=iso-8859-1’ . “\r\n”
Note: This Question is unanswered, help us to find answer for this one
Check Answer
286.
What is the difference between “echo” and “print” in PHP?
“echo“ can take multiple parameters, while “print” can only take a single parameter
“Print” has a return value of 1 so it can be used in expressions whereas “echo” has a void return type.
“Print” performs slightly slower than “echo”.
There is no difference between “print” and “echo”.
Answer
Correct Answer:
“echo“ can take multiple parameters, while “print” can only take a single parameter “Print” has a return value of 1 so it can be used in expressions whereas “echo” has a void return type. “Print” performs slightly slower than “echo”.
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Check Answer
287.
What piece of code would you use to obtain an array of response headers for a given URL, indexed by their respective names?
get_headers($url);
get_header($url);
get_headers($url,1);
Answer
Correct Answer:
get_headers($url,1);
Note: This Question is unanswered, help us to find answer for this one
Check Answer
288.
What super-global should be used to access information about uploaded files via a POST request?
$_SERVER
$_FILES
$_GET
$_ENV
Note: This Question is unanswered, help us to find answer for this one
Check Answer
289. The extent to which proximate procedures are related to one another is known as:
Coupling
Balancing
Cohesion
Co-relation
Note: This Question is unanswered, help us to find answer for this one
Check Answer
290.
Which is the correct way to profile a PHP function (without relying on 3rd party libraries and/or PHP extensions)?
$start = microtime(); functionToProfile(); $end = microtime(); $duration = $end - start;
$start = time(); functionToProfile(); $end = time(); $duration = $end - start;
$start = microtime(true); functionToProfile(); $end = microtime(true); $duration = $end - start;
$start = date('U'); functionToProfile(); $end = date('U'); $duration = $end - start;
Answer
Correct Answer:
$start = microtime(); functionToProfile(); $end = microtime(); $duration = $end - start;
Note: This Question is unanswered, help us to find answer for this one
Check Answer
291.
Which of the following statement is correct?
Interfaces can extend more than one interface
Interfaces can extend only one interface
Interfaces can inherit a method from different interfaces
Interfaces can re-declare inherited methods
Answer
Correct Answer:
Interfaces can extend more than one interface
Note: This Question is unanswered, help us to find answer for this one
Check Answer
292.
Which of the following is incorrect about empty()?
empty() checks if a variable is empty.
empty() can check expressions.
empty() can only check variables .
empty() returns false if a variable exists and has a non-empty value.
Answer
Correct Answer:
empty() can check expressions.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
293.
Which is true about the curl_setopt() API?
PHP does not provide such an API.
It sets multiple options for a cURL transfer.
It executes the curl command.
It sets one option for a cURL transfer.
Answer
Correct Answer:
It sets one option for a cURL transfer.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
294.
What is the use of memory_get_peak_usage()?
Returns the available memory on RAM
Returns the peak of memory allocated by PHP
Returns the peak of memory allocated by OS
No such function exist
Answer
Correct Answer:
Returns the peak of memory allocated by PHP
Note: This Question is unanswered, help us to find answer for this one
Check Answer
295.
What is the output of the following code? <?php function y($v) { echo $v; } $w = "y"; $w("z"); $w = "x"; ?>
x
y
z
<error>
Note: This Question is unanswered, help us to find answer for this one
Check Answer
296.
Which of the following is not a valid PHP debugger?
PHPTracer
Zend Debugger
APD
Xdebug
Note: This Question is unanswered, help us to find answer for this one
Check Answer
297.
Suppose after successful login following values are stored in session as per the given code:- session_start(); $_SESSION['logged'] = 1; $_SESSION['id'] = $id; $_SESSION['name'] = $contact_name; $_SESSION['email'] = $email; Now how will you remove the email value from the session?
unset($_SESSION)
unset($_SESSION['email'])
session_destory($_SESSION)
All of the above.
Answer
Correct Answer:
unset($_SESSION['email'])
Note: This Question is unanswered, help us to find answer for this one
Check Answer
298.
What is the use of the CDATA section in XML?
CDATA is used to store the content of an XML node.
CDATA is used to skip invalid characters.
XML does not have any CDATA section.
CDATA is used when PHP is used to update the content of an XML file.
Answer
Correct Answer:
CDATA is used to skip invalid characters.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
299.
Which of the following is a type of array in PHP?
string
compound
callback
scala
struct
Note: This Question is unanswered, help us to find answer for this one
Check Answer
300.
What is the correct way to read the result of a variable dump into a string?
$string = explode($variable);
$string = print_r($variable);
$string = serialize($variable);
$string = var_dump($variable);
Answer
Correct Answer:
$string = var_dump($variable);
Note: This Question is unanswered, help us to find answer for this one
Check Answer
301.
Which is the best way to automatically deploy a PHP website using git push?
It is not possible.
You should have two copies on your server. A bare copy, that you can push/pull from, to which you would push your changes to when you are done. Then you would clone this into your web directory and set up a cronjob to update git pull from your web directory every day or couple of days.
Developing from scratch a custom deployment script to manage all the aspects.
Copy over your git directory to your web server. On your local copy, modify your .git/config file and add your web server as a remote. On the server, replace .git/hooks/post-update with an existing script to process the rest of the workflow. Make the script executable.
Answer
Correct Answer:
Copy over your git directory to your web server. On your local copy, modify your .git/config file and add your web server as a remote. On the server, replace .git/hooks/post-update with an existing script to process the rest of the workflow. Make the script executable.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
302.
What is the output of the following code? <?php $a = 123; $b = "123"; if ($a == $b) echo 'A'; if ($a === $b) echo 'B'; ?>
empty output>
A
B
AB
Note: This Question is unanswered, help us to find answer for this one
Check Answer
303.
Which of the following is the best way to get the index(es) of the highest value(s) in an array?
$newarr=arsort($arr); $max_key=array_shift(array_keys($new_arr));
function max_key($array) { foreach ($array as $key => $val) { if ($val == max($array)) return $key; } }
$maxs = array_keys($array, max($array))
function array_max_key($array) { $max_key = -1; $max_val = -1; foreach ($array as $key => $value) { if ($value > $max_val) { $max_key = $key; $max_val = $value; } } return $max_key; }
Answer
Correct Answer:
$maxs = array_keys($array, max($array))
Note: This Question is unanswered, help us to find answer for this one
Check Answer
304.
Which of the following is false about foreach loop in PHP?
The foreach construct provides an easy way to iterate over arrays.
foreach works only on arrays and objects.
foreach loop can be used with a variable of any type.
foreach does not support the ability to suppress error messages using '@'.
Answer
Correct Answer:
foreach loop can be used with a variable of any type.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
305.
When user clicks on Logout link, the user is redirected to logout.php file and the file has following code? <?php session_unset(); session_destroy(); header("Location: index.php"); ?> What is wrong with the following code?
session_destory() should be called prior to session_unset().
The first line of the file should be session_start() so that session_destroy() will destroy the active session.
PHP will throw a fatal error since the required SESSIONID parameter is not passed in the session_destroy() method.
There is nothing wrong with the code and session will be destroyed and user will be redirected to index.php page.
Answer
Correct Answer:
The first line of the file should be session_start() so that session_destroy() will destroy the active session.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
306.
What will be the output of the following code? <?php $xmlFile = "<root><css><element><csstag><title>background-color</title><value>#FFF</value></csstag><csstag><title>color</title><value>#333</value></csstag><csstag><title>font-family</title><value>Verdana, Geneva, sans-serif</value></csstag></element></css></root>"; $xml = simplexml_load_string($xmlFile); foreach($xml->css as $css) { echo (string) $css->element['id']."{"; foreach($xml->css->element->csstag as $tag) { $temp = $tag->title.": ".$tag->value.";"; echo $temp; } echo "}"; } ?>
syntax error
background-color: #FFF;color: #333;font-family: Verdana, Geneva, sans-serif;
parse error;
{background-color: #FFF;color: #333;font-family: Verdana, Geneva, sans-serif;}
Answer
Correct Answer:
{background-color: #FFF;color: #333;font-family: Verdana, Geneva, sans-serif;}
Note: This Question is unanswered, help us to find answer for this one
Check Answer
307.
What is the output of the following code? <?php echo "<pre>"; $array1 = array( "1"=>"a", "2"=>"b", "3"=>"c" ); $array = array_flip($array1); print_r($array); echo "</pre>"; ?>
Array ( [1] => a [2] => b [3] => c )
Array ( [a] => 1 [b] => 2 [c] => 3 )
Array ( [0] => c [1] => b [2] => a )
Array ( [0] => 1 [1] => 2 [2] => 3 )
Answer
Correct Answer:
Array ( [a] => 1 [b] => 2 [c] => 3 )
Note: This Question is unanswered, help us to find answer for this one
Check Answer
308.
Which of the following options may be a reason for the error - "Call to undefined function curl_init()"?
cURL is not enabled.
curl_init() is not a valid API.
cURL only works on Linux.
All of these.
Answer
Correct Answer:
cURL is not enabled.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
309.
Which of the following is incorrect way to take a PHP variable named $name and reassign it to a javascript variable var name?
script> var name = " ?php echo $name;?>"; /script>
<script> var name =<?php echo $name;?>; </script>
<script> var name = <?php echo json_encode($name);?>; </script>
<script> var name = "<?php echo addslashes($name);?>"; </script>
Answer
Correct Answer:
<script> var name = <?php echo json_encode($name);?>; </script>
Note: This Question is unanswered, help us to find answer for this one
Check Answer
310.
What is a class in PHP?
A class is a blueprint for an object. Anobject encapsulates conceptually related states and responsibility of something in your application, and usually offers a programming interface with which to interact with these. This fosters code reuse and improves maintainability.
PHP is a C derived language for web scripting so it does not have the concept of a class.
A class is an instantiation of an object. It encapsulates conceptually related instance state information and responsibility of something in your application, and usually offers a programming interface with which to interact with these. This fosters code reuse and improves maintainability.
A class is a derived structure form stdObject. It is used to build Form-based Graphical user interface.
Answer
Correct Answer:
A class is a blueprint for an object. Anobject encapsulates conceptually related states and responsibility of something in your application, and usually offers a programming interface with which to interact with these. This fosters code reuse and improves maintainability.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
311.
What is “?” ?
A logical operator
A comparison operator
A ternary operator
A bitwise operator
None of the above
Answer
Correct Answer:
A ternary operator
Note: This Question is unanswered, help us to find answer for this one
Check Answer
312.
Which of the following statement about PHP is incorrect?
It is a server-side scripting language.
A .php file may contains text, html tags of scripts.
It can run on windows and Linux systems only.
It is compatible with most of the common servers used today.
Answer
Correct Answer:
It can run on windows and Linux systems only.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
313.
Why does the PHP function "require_once" work slower than "require"?
The system keeps a log of what has already been required in "require_once".
"require_once" uses more memory than "require".
"require_once" has to handle more exceptions than "require".
There is no difference in performance.
Answer
Correct Answer:
The system keeps a log of what has already been required in "require_once".
Note: This Question is unanswered, help us to find answer for this one
Check Answer
314.
Which of the following printing construct/function accepts multiple parameters?
echo
print
printf
All of these
Note: This Question is unanswered, help us to find answer for this one
Check Answer
315.
Which of the following is not true regarding XForms?
PHP provides support for XForms.
It can be used on PDF documents.
The data is sent in XML format.
The action and method parameters are defined in the body.
Answer
Correct Answer:
The action and method parameters are defined in the body.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
316.
What would be the output of the following code snippet?
<?php
for ($i = 'a'; $i <= 'z'; $i++)
echo "$i\n";
?>
(Note that new lines are replaced by spaces in the following choices.)
a b c d e f g h i j k l m n o p q r s t u v w x y z
a b c d e f g h i j k l m n o p q r s t u v w x y z aa ab ac ad ae af ag ah ai aj ak al am an ao ap aq ar as at au av aw ax ay az ba bb bc bd be bf bg bh bi bj bk bl bm bn bo bp bq br bs bt bu bv bw bx by bz ca cb cc cd ce cf cg ch ci cj ck cl cm cn co cp cq cr cs ct cu cv cw cx cy cz da db dc dd de df dg dh di dj dk dl dm dn do dp dq dr ds dt du dv dw dx dy dz ea eb ec ed ee ef eg eh ei ej ek el em en eo ep eq er es et eu ev ew ex... on to yz
aa ab ac ad ae af ag ah ai aj ak al am an ao ap aq ar as at au av aw ax ay az ba bb bc bd be bf bg bh bi bj bk bl bm bn bo bp bq br bs bt bu bv bw bx by bz ca cb cc cd ce cf cg ch ci cj ck cl cm cn co cp cq cr cs ct cu cv cw cx cy cz da db dc dd de df dg dh di dj dk dl dm dn do dp dq dr ds dt du dv dw dx dy dz ea eb ec ed ee ef eg eh ei ej ek el em en eo ep eq er es et eu ev ew ex... on to yz
abcdefghijklmnopqrstuvwxyz
Answer
Correct Answer:
aa ab ac ad ae af ag ah ai aj ak al am an ao ap aq ar as at au av aw ax ay az ba bb bc bd be bf bg bh bi bj bk bl bm bn bo bp bq br bs bt bu bv bw bx by bz ca cb cc cd ce cf cg ch ci cj ck cl cm cn co cp cq cr cs ct cu cv cw cx cy cz da db dc dd de df dg dh di dj dk dl dm dn do dp dq dr ds dt du dv dw dx dy dz ea eb ec ed ee ef eg eh ei ej ek el em en eo ep eq er es et eu ev ew ex... on to yz
Note: This Question is unanswered, help us to find answer for this one
Check Answer
317.
What is the output of the following code?
<?php
$array =array (“1”,”2”,”3”,”4”);
$variable = end (array_keys ($array ) );
Echo $variable;
?>
1
2
3
4
Note: This Question is unanswered, help us to find answer for this one
Check Answer
318.
Which of the following will return the complete URL of the requested PHP page?
apache_getenv("HTTP_HOST")
$_SERVER['HTTP_HOST']
$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
$_SERVER['REQUEST_URI'];
Answer
Correct Answer:
$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
Note: This Question is unanswered, help us to find answer for this one
Check Answer
319.
Is the following code valid? <? $a = 5; if ($a == 5): echo "Hello"; echo "1"; else: echo "Not hello"; echo "2"; endif; ?>
Yes
No
Note: This Question is unanswered, help us to find answer for this one
Check Answer
320.
Which of the following will not return an array containing all normal Latin alphabet characters (A-Z)?
range('A', 'Z');
range('a', 'z');
range(chr(65),chr(90))
range(65,90)
Answer
Correct Answer:
range(65,90)
Note: This Question is unanswered, help us to find answer for this one
Check Answer
321.
What is the initial value of a variable?
"0"
NULL
Any value
Note: This Question is unanswered, help us to find answer for this one
Check Answer
322.
What is meant by Synchronous Server Calls within PHP's cURL features?
Performing server calls simultaneously.
Performing server calls within batches.
Performing server calls one after each other.
Performing server calls in parallel.
Answer
Correct Answer:
Performing server calls in parallel.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
323.
What is the fastest way to insert an item $item into the specified position $position of the array $array?
array_insert()
array_splice()
array_merge() and array_slice()
PHP does not have any built-in function that can do this: the source array will have to be copied, and $item inserted in to the required position: $n = 0; foreach ($array as $key => $val) { if ($n == $position) { $target[] = $item; } ++$n; $target[$key] = $val; }
Answer
Correct Answer:
array_merge() and array_slice()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
324.
How do you erase an element from an array, with numeric keys, to maintain a normalized integer series?
$x[0]=null;
$x = array_values($x); unset($x[0]);
unset($x[0]); $x = array_values($x);
delete $x[0]
Answer
Correct Answer:
unset($x[0]); $x = array_values($x);
Note: This Question is unanswered, help us to find answer for this one
Check Answer
325.
Which function is used to destroy a variable or object?
destroy()
clear()
unset()
reset()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
326.
A file needs to be opened in a PHP application. Additionally, the application has to issue a warning and continue execution, in case the file is not found. The ideal function to use is:
include()
require()
nowarn()
getFile(false)
Answer
Correct Answer:
include()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
327.
What is the output of the following code?
<?php
echo (2) . (3 * (print 3));
?>
233
29
329
323
Syntax error
Note: This Question is unanswered, help us to find answer for this one
Check Answer
328.
What will be the output of the following code?
<?php
$str="Hello";
$test="lo";
echo substr_compare($str, $test, -strlen($test), strlen($test)) === 0;
?>
FALSE
Syntax error
0
1
Note: This Question is unanswered, help us to find answer for this one
Check Answer
329.
What will be the output of the following code?
<?php
</script>
?>
Parse Error
Fatal Error
</script>
?>
Note: This Question is unanswered, help us to find answer for this one
Check Answer
330.
Which of the following is not related to debugging in PHP?
watch
PDO
breakpoints
call stack
Note: This Question is unanswered, help us to find answer for this one
Check Answer
331.
What will be the output of the following code?
<?php
$numbers=array();
$numbers[1] = 1;
$numbers[2] = 2;
$numbers[3] = 3;
$numbers[4] = 4;
$key= array_search(3,$numbers);
unset($numbers[$key]);
print_r($numbers);
?>
Array ( [1] => 1 [2] => 2 [3] => 4 )
Array ( [1] => 1 [2] => 2 [4] => 4 )
Array ( [0] => 1 [1] => 2 [2] => 4 )
Array ( [0] => 1 [2] => 2 [3] => 4 )
Answer
Correct Answer:
Array ( [1] => 1 [2] => 2 [4] => 4 )
Note: This Question is unanswered, help us to find answer for this one
Check Answer
332.
Which of the following features are supported in PHP5?
Multiple Inheritance
Embedded Database with SQLite
Exceptions and Iterators
Interoperable XML Tools
Answer
Correct Answer:
Embedded Database with SQLite
Note: This Question is unanswered, help us to find answer for this one
Check Answer
333.
What is the output of the following code?
<?php
echo 0x500;
?>
500
0x500
0500
1280
320
Note: This Question is unanswered, help us to find answer for this one
Check Answer
334.
Which of the following statements is incorrect?
In a try catch block, the catch block should only appear after the try block.
A try block can have more than one catch block.
A try block can have only one catch block.
When an exception occurs in a try block, control goes to the catch block or the following finally block.
Answer
Correct Answer:
A try block can have only one catch block.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
335.
Which of the following is the correct way to convert a variable from a string to an integer?
$number_variable = int_val $string_variable;
$number_variable = (int_val)$string_variable;
$number_variable = int($string_variable);
$number_variable = (int)$string_variable;
Answer
Correct Answer:
$number_variable = (int)$string_variable;
Note: This Question is unanswered, help us to find answer for this one
Check Answer
336.
Which one of these should be avoided with respect to the database username and password in PHP?
Always store database username and password in a PHP file.
Store the database username and password in a configuration file outside the webroot.
The username used for connecting to the database should only have limited access to the database.
Avoid a single database user having access to multiple databases if not required.
Answer
Correct Answer:
Always store database username and password in a PHP file.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
337.
Which of the following is incorrect with respect to separating PHP code and HTML?
Use MVC design.
As PHP is a scripting language, so HTML and PHP cannot be separated.
Use any PHP template engine e.g: smarty to keep the view from business logic.
Create one script containing your (PHP) logic outputting XML and one script produce the XSL to translate the XML to your views.
Answer
Correct Answer:
Create one script containing your (PHP) logic outputting XML and one script produce the XSL to translate the XML to your views.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
338.
What is the correct PHP command for setting a MySQL connection character set to UTF8?
mysqli_client_encoding($link, "utf8");
mysqli_character_set_name($link, "utf8");
mysqli_set_charset($link, "utf8");
mysql_character_set_name($link, "utf8");
Answer
Correct Answer:
mysqli_set_charset($link, "utf8");
Note: This Question is unanswered, help us to find answer for this one
Check Answer
339.
What will be the output of the following code?
class Person
{
protected $name;
public function __construct($name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
}
$person = new Person("Foo");
echo $person->getName();
Nothing will be printed on-screen.
Foo
Syntax error on line $this->name=$name
Fatal error on line $this->name=$name
Note: This Question is unanswered, help us to find answer for this one
Check Answer
340.
Which of the following is true with respect to database tables in PHP?
New database tables cannot be created using PHP.
The structure of an existing table cannot be altered using PHP.
An existing table cannot be dropped using PHP.
New database tables can be created using PHP, provided that the user connecting to the database has enough privileges.
Answer
Correct Answer:
New database tables can be created using PHP, provided that the user connecting to the database has enough privileges.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
341.
Why is it not recommended to use $_REQUEST when handling form submissions in PHP?
It's difficult to determine whether it is a $_POST or $_GET request.
$_REQUEST is deprecated.
$_REQUEST includes $_COOKIE by default, and parameters from $_COOKIE with the same name may be overriden with parameters from $_GET or $_POST.
$_REQUEST does not handle HTTP rquests, it handles database requests.
Answer
Correct Answer:
$_REQUEST includes $_COOKIE by default, and parameters from $_COOKIE with the same name may be overriden with parameters from $_GET or $_POST.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
342.
How would you guarantee a reliable expiration of a PHP session after 30 minutes?
Use session.gc_maxlifetime which specifies the number of seconds after which data will be seen as 'garbage' and cleaned up. Garbage collection occurs during session start.
Use session.cookie_lifetime which specifies the lifetime of the cookie in seconds, which is then sent to the browser.
Session timeout management should be implemented manually.
All PHP sessions end after 30 minutes.
Answer
Correct Answer:
Use session.gc_maxlifetime which specifies the number of seconds after which data will be seen as 'garbage' and cleaned up. Garbage collection occurs during session start.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
343.
What is a salted MD5 hashed password?
It is MD5 representation of a password.
It is doubly MD5 representation of a password.
It is MD5 representation of a random string concatenated with MD5 of a password.
There is no such thing as salted MD5.
Answer
Correct Answer:
It is MD5 representation of a random string concatenated with MD5 of a password.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
344.
Which of the following is incorrect with respect to json_encode and serialize()?
Both methods are same and produces json only.
JSON converts UTF-8 characters to unicode escape sequences. serialize() does not.
json_encode() generates the JSON representation of a value while serialize() generates a storable representation of a value.
Any data encoded with json_encode() function can be used outside a PHP application whereas data generated with serialize() can only be used in a PHP application.
Answer
Correct Answer:
Any data encoded with json_encode() function can be used outside a PHP application whereas data generated with serialize() can only be used in a PHP application.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
345.
Which of the following is the correct way to create two independent connections to MySQL in PHP?
$dbh1 = mysql_connect($hostname, $username, $password);
$dbh2 = mysql_connect($hostname, $username, $password, true);
$dbh1 = mysql_connect($hostname, $username, $password, 1);
$dbh2 = mysql_connect($hostname, $username, $password, 2);
$dbh1 = mysql_connect($hostname, $username, $password, +1);
$dbh2 = mysql_connect($hostname, $username, $password, -1);
$dbh1 = mysql_connect($hostname, $username, $password,'primary');
$dbh2 = mysql_connect($hostname, $username, $password, 'secondary');
Answer
Correct Answer:
$dbh1 = mysql_connect($hostname, $username, $password);
$dbh2 = mysql_connect($hostname, $username, $password, true);
Note: This Question is unanswered, help us to find answer for this one
Check Answer
346.
What is the difference between $a == $b and $a === $b in PHP?
There is no difference.
'==' checks whether $a and $b have the same string representation, '===' checks whether the values are of the same type and $a is equal to $b.
'==' checks whether $a and $b have the same string representation, '===' checks whether $a and $b are equal after type juggling.
'==' checks whether $a and $b are equal after type juggling, '===' checks whether $a and $b are equal and are of the same type.
Answer
Correct Answer:
'==' checks whether $a and $b are equal after type juggling, '===' checks whether $a and $b are equal and are of the same type.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
347.
What will be the output of the following code?
<?
$a = 0x01;
$b = 0x02;
printf ("%x", ($a << $b.$b));
?>
0
1
10000
400000
800000
Syntax error
Note: This Question is unanswered, help us to find answer for this one
Check Answer
348.
Which of the following methods is used to check if an array is associative or numeric?
is_Assoc().
isAssoc()
is_assoc()
None of the above.
Answer
Correct Answer:
isAssoc()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
349.
Which of the following would trigger the browser's "Save As" prompt?
header('file.txt');
header('location: file.txt');
header('Content-type: application/txt');
header('location: file.txt');
echo "file contents";
header('Content-type: application/txt');
header('Content-Disposition: attachment; filename="file.txt"');
echo "file contents";
Answer
Correct Answer:
header('Content-type: application/txt');
header('Content-Disposition: attachment; filename="file.txt"');
echo "file contents";
Note: This Question is unanswered, help us to find answer for this one
Check Answer
350.
Which method is used to capture the whole screen in PHP?
imagegrabscreen();
imagegrabwindow()
imagealphablending()
getimagesizefromstring()
Answer
Correct Answer:
imagegrabscreen();
Note: This Question is unanswered, help us to find answer for this one
Check Answer
351.
What is the best method for sanitizing user input with PHP?
PHP has a specific feature named magic-quotes to sanitize everything.
In general there is no need to sanitize input, apart from specific situations.
Whenever you embed a string within foreign code, you must escape it, according to the rules of that language. E.g. for MySQL, you will use mysql_real_escape_string, for HTML you will escape it with htmlspecialchars.
PHP exposes Regex functionalities to parse and sanitize everything.
Answer
Correct Answer:
Whenever you embed a string within foreign code, you must escape it, according to the rules of that language. E.g. for MySQL, you will use mysql_real_escape_string, for HTML you will escape it with htmlspecialchars.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
352.
What is the use of the @ symbol in front of a variable?
It sets the type of that variable to a string.
It sets the type of that variable to an array.
It hides any error messages coming from the expression.
It has no use and would return an error.
Answer
Correct Answer:
It hides any error messages coming from the expression.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
353.
What is the output of the following code?
<?php
$string1 = "abcdefg";
$string2 = "abcfghi";
$position = strspn($string1 ^ $string2, "\0");
echo $position;
?>
1
2
3
4
Note: This Question is unanswered, help us to find answer for this one
Check Answer
354.
The built-in function to get the number of parameters passed is:
arg_num()
func_args_count()
func_num_args()
None of these
Answer
Correct Answer:
func_num_args()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
355.
In PHP5, what is the difference between using self and $this, and when is each appropriate?
$this is for use in static member functions to allow access to static member variables. Use self in non-static member functions, and as a reference to the instance of the class on which the member function was called.
self is for use in static member functions to allow access to static member variables. $this is used in non-static member functions, and is a reference to the instance of the class on which the member function was called, but also allows access to static member functions.
The self keyword does not exist.
There is no difference between the two keywords; it is simply syntactic sugar.
Answer
Correct Answer:
self is for use in static member functions to allow access to static member variables. $this is used in non-static member functions, and is a reference to the instance of the class on which the member function was called, but also allows access to static member functions.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
356.
What is the output of the following code?
<?php
function abc()
{
return __FUNCTION__;
}
function xyz()
{
return abc();
}
echo xyz();
?>
abc
__FUNCTION__
xyz
empty output
Note: This Question is unanswered, help us to find answer for this one
Check Answer
357.
Which of the following is not a valid Xdebug configuration setting?
xdebug.var_display_max_depth
xdebug.var_display_max_children
xdebug.var_display_max_data
xdebug.trace
Answer
Correct Answer:
xdebug.trace
Note: This Question is unanswered, help us to find answer for this one
Check Answer
358.
Which of the following will read an object into an array variable?
$array_variable = get_object_vars($object);
$array_variable = (array)$object;
$array_variable = array $object;
$array_variable = get_object_vars $object;
Answer
Correct Answer:
$array_variable = get_object_vars($object);
Note: This Question is unanswered, help us to find answer for this one
Check Answer
359.
Which code snippet outputs a random string?
<?php Function RandomString() { $characters = ’0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ’; $randstring = ''; for ($i = 0; $i < 10; $i++) { $randstring = $characters[rand(0, strlen($characters))]; } return $randstring; } RandomString(); echo $randstring; ?>
function generateRandomString($length = 10) { $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; $randomString = ''; for ($i = 0; $i < $length; $i++) { $randomString .= $characters[rand(0, strlen($characters) - 1)]; } return $randomString; }
function generateRandomString($length = 15) { return substr(sha1(rand()), 0, 0); }
function RandomString($length) { $keys = array_merge(range(0,9), range('a', 'z')); for($i=0; $i < $length; $i++) { $key = $keys[array_rand($keys)]; } return $key; }
Answer
Correct Answer:
function generateRandomString($length = 10) { $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; $randomString = ''; for ($i = 0; $i < $length; $i++) { $randomString .= $characters[rand(0, strlen($characters) - 1)]; } return $randomString; }
Note: This Question is unanswered, help us to find answer for this one
Check Answer
360.
What is wrong with the following code?
curl_setopt($ch, CURLOPT_URL,
“http://www.example.com/”);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_exec($ch);
curl_close($ch);
?>
There is nothing wrong with the code.
The cURL resource $ch has not been created using the curl_init() method.
The $ch variable needs to be initialized as $ch=null;.
The code will cause a parse error.
Answer
Correct Answer:
The cURL resource $ch has not been created using the curl_init() method.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
361.
What is the output of the following code?
<?php
function
vec_add (&$a, $b)
{
$a['x'] += $b['x'];
$a['y'] += $b['y'];
$a['z'] += $b['z'];
}
$a = array (x => 3, y => 2, z => 5);
$b = array (x => 9, y => 3, z => -7);
vec_add (&$a, $b);
print_r ($a);
?>
Array ( [x] => 9 [y] => 3 [z] => -7 )
Array ( [x] => 3 [y] => 2 [z] => 5 )
Array ( [x] => 12 [y] => 5 [z] => -2 )
Error
None of the above
Answer
Correct Answer:
Array ( [x] => 12 [y] => 5 [z] => -2 )
Note: This Question is unanswered, help us to find answer for this one
Check Answer
362.
What is the difference between the float and the double type in PHP?
Float is 32-bit while double is 64-bit.
Float represents only rational numbers.
Float and double are aliases for the same thing.
None of these.
Answer
Correct Answer:
Float and double are aliases for the same thing.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
363.
Which of the following is the correct way to check if a session has already been started?
if ($_SERVER["session_id"]) echo 'session started';
if (session_id()) echo 'session started';
if ($_SESSION["session_id"]) echo 'session started';
if ($GLOBALS["session_id"]) echo 'session started';
Answer
Correct Answer:
if (session_id()) echo 'session started';
Note: This Question is unanswered, help us to find answer for this one
Check Answer
364.
What will be the output of the following code?
<?php
echo 30 * 5 . 7;
?>
150 . 7
1507
150.7
Integers can't be concatenated.
An error will be thrown.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
365.
What will be the output of the following code?
<?
$a = (1 << 0);
$b = (1 << 1);
echo ($b | $a) << 2 ;
?>
1
2
3
4
8
12
Syntax error
Note: This Question is unanswered, help us to find answer for this one
Check Answer
366.
What will be the output of the following code?
<?
$foo = 5 + "10 things";
print $foo;
?>
510 things
5 10 things
15 things
15
None of these
Note: This Question is unanswered, help us to find answer for this one
Check Answer
367.
What is the output of the following code?
echo '1'.print(2) + 3;
123
321
511
155
432
Note: This Question is unanswered, help us to find answer for this one
Check Answer
368.
Which of the following are valid PHP data types?
resource
null
boolean
string
All of these
Note: This Question is unanswered, help us to find answer for this one
Check Answer
369.
Which of the following is true regarding the str_replace() function in PHP?
It requires a minimum of 2 parameters.
The first argument is the string or array being searched and replaced.
The second argument is the the replacement value that replaces found search values.
It will replace only the first matched string.
Answer
Correct Answer:
It requires a minimum of 2 parameters.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
370.
Which of the following is the right MIME to use as a Content Type for JSON data?
text/x-json
text/javascript
application/json
application/x-javascript
Answer
Correct Answer:
application/json
Note: This Question is unanswered, help us to find answer for this one
Check Answer
371.
Which of the following will not give the correct date and time in PHP?
date("Y-m-d H:i:s")
date("y-m-d H:i:s")
date("f, j Y H:i:s")
date("F, j Y H:i:s")
Answer
Correct Answer:
date("F, j Y H:i:s")
Note: This Question is unanswered, help us to find answer for this one
Check Answer
372.
How should a variable be declared in a function, if the value has to be retained over multiple calls?
local
global
static
None of these
Note: This Question is unanswered, help us to find answer for this one
Check Answer
373.
What is the correct way to read-in multiple values from an array?
$x,$y,$z = array(7,8,9);
($x,$y,$z) = array(7,8,9);
array($x,$y,$z) = array(7,8,9);
list($x,$y,$z) = array(7,8,9);
Answer
Correct Answer:
list($x,$y,$z) = array(7,8,9);
Note: This Question is unanswered, help us to find answer for this one
Check Answer
374.
Which of the following is not a valid cURL parameter in PHP?
CURLOPT_RETURNTRANSFER
CURLOPT_GET
CURLOPT_POST
CURLOPT_POSTFIELDS
Answer
Correct Answer:
CURLOPT_GET
Note: This Question is unanswered, help us to find answer for this one
Check Answer
375.
Which of the following is a correct declaration?
static $varb = array(1,'val',3);
static $varb = 1+(2*90);
static $varb = sqrt(81);
static $varb = new Object;
Answer
Correct Answer:
static $varb = array(1,'val',3);
Note: This Question is unanswered, help us to find answer for this one
Check Answer
376.
Which of the following is a ternary operator?
&
=
:?
?:
+=
&&
Note: This Question is unanswered, help us to find answer for this one
Check Answer
377.
Which statement will return true?
is_numeric ("200")
is_numeric ("20,0")
is_numeric ("$200")
is_numeric (".25e4")
None
Answer
Correct Answer:
is_numeric ("200")
Note: This Question is unanswered, help us to find answer for this one
Check Answer
378.
Which function is used to calculate the amount of memory allocated to a PHP script?
emalloc()
get_total_memory_usage()
get_memory_usage()
memory_get_usage()
Answer
Correct Answer:
memory_get_usage()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
379.
Consider the following statements: I : while (expr) statement II: while (expr): statement ... endwhile; Which of the following is true, in the context of the given statements?
I is correct and II is wrong.
I is wrong and II is correct.
Both I and II are wrong.
Both I and II are correct.
Answer
Correct Answer:
Both I and II are correct.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
380.
What is the correct use of the constant, PHP_EOL?
For displaying a new line within an HTML document.
For writing a new line that is cross-platform compatible.
As an 'End Of Line' character for only DOS systems.
As an 'End Of Line' character for only UNIX systems.
Answer
Correct Answer:
For writing a new line that is cross-platform compatible.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
381.
Which is the best approach to parse HTML and extract structured information from it?
Use an existing LibXML based library like DOM or phpQuery.
String searching and extraction.
Use an XML parser (as simpleXML) and XPath queries if available.
Use specific regular expressions.
Answer
Correct Answer:
Use an XML parser (as simpleXML) and XPath queries if available.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
382.
Which of the following is the best way to convert one date format into another; portable for all PHP versions?
$myDateTime = DateTime::createFromFormat('Y-m-d', $dateString); $newDateString = $myDateTime->format('m/d/Y');
newDateString = $myDateTime->format('m/d/Y');
2. $old_date = date('l, F d y h:i:s'); $old_date_timestamp = strtotime($old_date); $new_date = date('Y-m-d H:i:s', $old_date_timestamp);
implode('-', array_reverse(explode('-', $date)));
$old_date = date('y-m-d-h-i-s'); preg_match_all('/(\.+)-(\d+)-(\w+)-(\d+)-(\w+)-(\w+)/', $old_date, $out); $out = $out[0]; $time = mktime($out[4], $out[5], $out[6], $out[2], $out[3], $out[1]); $new_date = date('Y-m-d H:i:s', $time);
Answer
Correct Answer:
$myDateTime = DateTime::createFromFormat('Y-m-d', $dateString); $newDateString = $myDateTime->format('m/d/Y');
Note: This Question is unanswered, help us to find answer for this one
Check Answer
383.
Which of the following statements is incorrect, with regards to inheritance in PHP?
A class can only have a single parent, i.e. it cannot extend more than one class.
A class can both extend another class as well as implement an interface.
A class can implement more than one interface.
A class can extend more than one class.
Answer
Correct Answer:
A class can extend more than one class.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
384.
Is the ||= operator present in PHP?
yes
no
Note: This Question is unanswered, help us to find answer for this one
Check Answer
385.
With what encoding does chr() work?
ASCII
UTF-8
UTF-16
Implementation dependent
None of these
Note: This Question is unanswered, help us to find answer for this one
Check Answer
386.
Which of the following will return the extension of a file name?
pathinfo($filepath,PATHINFO_DIRNAME).
pathinfo($filepath,PATHINFO_BASENAME).
pathinfo($filepath,PATHINFO_EXTENSION).
pathinfo($filepath,PATHINFO_FILENAME).
Answer
Correct Answer:
pathinfo($filepath,PATHINFO_EXTENSION).
Note: This Question is unanswered, help us to find answer for this one
Check Answer
387.
Which of the following code snippets has the most appropriate headers to force the browser to download a CSV file?
header("Content-type: text/csv");
header("Content-Disposition: attachment; filename=file.csv");
header("Pragma: no-cache");
header("Expires: 0");
header('Content-Type: application/download');
header("Content-Disposition: attachment; filename=file.csv");
header("Pragma: no-cache");
header("Expires: 0");
header('Content-Type: application/csv');
header("Content-Disposition: attachment; filename=file.csv");
header("Pragma: no-cache");
header("Expires: 0");
header('Content-Type: application/octet-stream');
header("Content-Disposition: attachment; filename=file.csv");
header("Pragma: no-cache");
header("Expires: 0");
Answer
Correct Answer:
header("Content-type: text/csv");
header("Content-Disposition: attachment; filename=file.csv");
header("Pragma: no-cache");
header("Expires: 0");
Note: This Question is unanswered, help us to find answer for this one
Check Answer
388.
With regards to the "static" keyword in PHP, which of the following statements is false?
The $this variable can be used inside any static method.
Static properties may only be initialized using a literal or a constant.
A property declared as static can not be accessed with an instantiated class object.
A static variable or method can be accessed without requiring instantiation of the class.
Answer
Correct Answer:
The $this variable can be used inside any static method.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
389.
Which of the following environment variables is used to fetch the IP address of the user in a PHP application?
$IP_ADDR
$REMOTE_ADDR_USER
$REMOTE_ADDR
$IP_ADDR_USER
Answer
Correct Answer:
$REMOTE_ADDR
Note: This Question is unanswered, help us to find answer for this one
Check Answer
390.
Which of the following statements is true about the "new" operator in PHP?
It is used to define a new variable.
It creates and allocates memory for a new object.
It is used to call the constructor.
The "new" operator does not exist in PHP.
Answer
Correct Answer:
It is used to call the constructor.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
391.
Which function is used to remove the first element of an array?
array_remove_first_element
array_shift
array_ltrim
a[0] = nil
None of these
Answer
Correct Answer:
array_shift
Note: This Question is unanswered, help us to find answer for this one
Check Answer
392.
Which of the following is false about cURL?
cURL can be used to send plain text data to a remote server.
cURL can be used to send both text as well as files using a single request.
cURL can be used to send files to a remote server.
Files cannot be sent using cURL.
Answer
Correct Answer:
Files cannot be sent using cURL.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
393.
What would be the output of the following code?
<?php
$arr = array("foo",
"bar",
"baz");
for ($i = 0; $i < count($arr); $i++) {
$item = $arr[$i];
}
echo "<pre>";
print_r($item);
echo "</pre>";
?>
Array
(
[0] => foo
[1] => bar
[2] => baz
)
foo
bar
baz
Note: This Question is unanswered, help us to find answer for this one
Check Answer
394.
Which of the following is not a valid DOM method in PHP?
loadXMLFile()
loadXML()
loadHTMLFile()
loadHTML()
Answer
Correct Answer:
loadXMLFile()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
395.
What is "empty()"?
A function
A language construct
A variable
A reference
None of these
Answer
Correct Answer:
A function
Note: This Question is unanswered, help us to find answer for this one
Check Answer
396.
Which of the following regular expressions can be used to check the validity of an e-mail addresss?
^[^@ ]+@[^@ ]+\.[^@ ]+$
^[^@ ]+@[^@ ]+.[^@ ]+$
$[^@ ]+@[^@ ]+\.[^@ ]+^
$[^@ ]+@[^@ ]+.[^@ ]+^
Answer
Correct Answer:
^[^@ ]+@[^@ ]+\.[^@ ]+$
Note: This Question is unanswered, help us to find answer for this one
Check Answer
397. Should assert() be used to check user input?
Yes
No
Note: This Question is unanswered, help us to find answer for this one
Check Answer
398.
Given the following array:
$array = array(0 => 'blue', 1 => 'red', 2 => 'green', 3 => 'red');
Which one of the following will print 2?
echo array_search('green', $array);
echo in_array('green', $array);
echo array_key_exists(2, $array);
echo array_search('red',$array);
Answer
Correct Answer:
echo array_search('green', $array);
Note: This Question is unanswered, help us to find answer for this one
Check Answer
399.
What is the meaning of the system message, "Allowed memory size of <number> bytes exhausted"?
The available RAM memory is exhausted.
The available disk memory is exhausted.
This occurs randomly due to parsing errors.
The maximum memory allocated in php.ini is exhausted.
Answer
Correct Answer:
The maximum memory allocated in php.ini is exhausted.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
400.
What will be the output of following code? $a = 10; echo "Value of a = $a";
Value of a = 10
Value of a = $a
Undefined
Syntax Error
Answer
Correct Answer:
Value of a = 10
Note: This Question is unanswered, help us to find answer for this one
Check Answer
401.
Which of the following is not a valid php.ini parameter with respect to file uploading?
upload_max_filesize
allow_url_fopen
upload_tmp_dir
post_max_size
Answer
Correct Answer:
allow_url_fopen
Note: This Question is unanswered, help us to find answer for this one
Check Answer
402.
Which of these is not a valid SimpleXML Parser method?
simplexml_import_dom()
simplexml_import_sax()
simplexml_load_file()
simplexml_load_string()
Answer
Correct Answer:
simplexml_import_sax()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
403.
Which of the following is not a valid PHP parser tag?
<script>
<?p
<%
<?php
Note: This Question is unanswered, help us to find answer for this one
Check Answer
404.
Which of the following is the operator with the highest precedence?
+
instanceof
new
=
None of the above
Note: This Question is unanswered, help us to find answer for this one
Check Answer
405.
Which of the following file modes is used to write into a file at the end of the existing content, and create the file if the file does not exist?
r+
w+
a
x
Note: This Question is unanswered, help us to find answer for this one
Check Answer
406.
Which of the following functions is not related to garbage collection in PHP?
gc_collect_cycles()
gc_cycles()
gc_disable()
gc_enable()
Answer
Correct Answer:
gc_cycles()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
407.
What is the best way to load a file that contains necessary functions and classes?
include($filename);
require($filename);
include_once($filename);
require_once($filename);
Answer
Correct Answer:
require_once($filename);
Note: This Question is unanswered, help us to find answer for this one
Check Answer
408.
Which of the following is true about posting data using cURL in PHP?
Data can be posted using only the POST method.
Data can be posted using only the GET method.
Data can be posted using both GET and POST methods.
Data cannot be posted using cURL.
Answer
Correct Answer:
Data can be posted using both GET and POST methods.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
409.
What is the difference between die() and exit() in PHP?
die() is an alias for exit().
exit() is a function, die() is a language construct and cannot be called using variable functions.
die() accepts a string as its optional parameter which is printed before the application terminates; exit() accepts an integer as its optional parameter which is passed to the operating system as the exit code.
die() terminates the script immediately, exit() calls shutdown functions and object destructors first.
Answer
Correct Answer:
die() is an alias for exit().
Note: This Question is unanswered, help us to find answer for this one
Check Answer
410.
Which of the following functions is not used in debugging?
var_dump()
fprintf()
print_r()
var_export()
Answer
Correct Answer:
var_export()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
411.
Which of these is not a valid PHP XML API?
libxml_clear_errors()
libXMLError()
libxml_get_errors()
libxml_use_internal_errors()
Answer
Correct Answer:
libxml_use_internal_errors()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
412.
Without introducing a non-class member variable, which of the following can be used to keep an eye on the existing number of objects of a given class?
Adding a member variable that gets incremented in the default constructor and decremented in the destructor.
Adding a local variable that gets incremented in each constructor and decremented in the destructor.
Add a static member variable that gets incremented in each constructor and decremented in the destructor.
This cannot be accomplished since the creation of objects is being done dynamically via "new."
Answer
Correct Answer:
Add a static member variable that gets incremented in each constructor and decremented in the destructor.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
413.
Consider the following class:
1 class Insurance
2 {
3 function clsName()
4 {
5 echo get_class($this);
6 }
7 }
8 $cl = new Insurance();
9 $cl->clsName();
10 Insurance::clsName();
Which of the following lines should be commented to print the class name without errors?
Line 8 and 9
Line 10
Line 9 and 10
All the three lines 8,9, and 10 should be left as it is.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
414.
Which of the following is not a valid API?
trigger_print_error()
trigger_error()
debug_backtrace()
debug_print_backtrace()
Answer
Correct Answer:
trigger_print_error()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
415.
What will be the output of the following code? $Rent = 250; function Expenses($Other) { $Rent = 250 + $Other; return $Rent; } Expenses(50); echo
$Rent;
300
250
200
The program will not compile.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
416.
Consider the following 2D array in PHP:
$array = array(array(141,151,161), 2, 3, array(101, 202, 303));
Which of the following will display all values in the array?
function DisplayArray($array) {
foreach ($array as $value) {
if (array_valid($value)) {
DisplayArray($value);
} else {
echo $value . "
";
}
}
}
DisplayArray($array);
function DisplayArray($array) {
for ($array as $value) {
if (valid_array($value)) {
DisplayArray($value);
} else {
echo $value . "
";
}
}
}
DisplayArray($array);
function DisplayArray($array) {
for ($array as $value) {
if (is_array($value)) {
DisplayArray($value);
} else {
echo $value . "
";
}
}
}
DisplayArray($array);
function DisplayArray($array) {
foreach ($array as $value) {
if (is_array($value)) {
DisplayArray($value);
} else {
echo $value . "
";
}
}
}
DisplayArray($array);
Answer
Correct Answer:
function DisplayArray($array) {
foreach ($array as $value) {
if (is_array($value)) {
DisplayArray($value);
} else {
echo $value . "
";
}
}
}
DisplayArray($array);
Note: This Question is unanswered, help us to find answer for this one
Check Answer
417.
Which of the following statements regarding PHP forms, are correct?
In PHP, the predefined $_POST variable is used to collect values in a form with method="post".
In PHP, the predefined $_GET variable is used to collect values in a form with method="get".
In PHP, the predefined $_REQUEST variable contains the contents of both $_GET, $_POST, and $_COOKIE.
Information sent from a form with the POST method is invisible to others and has an 8MB limit on the amount of information to send, which cannot be changed.
Answer
Correct Answer:
In PHP, the predefined $_REQUEST variable contains the contents of both $_GET, $_POST, and $_COOKIE.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
418.
Which of the the following are PHP file upload-related functions?
upload_file()
is_uploaded_file()
move_uploaded_file()
None of these
Answer
Correct Answer:
is_uploaded_file()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
419.
If you want to pass a value to a function by reference, the correct way is: function ModifyReport(&$Rptfile){}
function ModifyReport($Rptfile){}
function ModifyReport(ByRef $Rptfile){}
function ModifyReport(&Rptfile){}
d
Note: This Question is unanswered, help us to find answer for this one
Check Answer
420.
The default value of register global in PHP is:
Off
On
a
Note: This Question is unanswered, help us to find answer for this one
Check Answer
421.
Which one of the following is turnary operator?
&
=
?:
+=
&&
d
Note: This Question is unanswered, help us to find answer for this one
Check Answer
422.
you have defined three variables $to, $subject, and $body to send an email. Which of the following methods would you use for sending an email?
mail($to, $subject,$body)
sendmail($to, $subject,$body)
mail(to, subject,body)
sendmail(to, subject,body)
a
Note: This Question is unanswered, help us to find answer for this one
Check Answer
423.
Which of the following are “magic constant”?
__LINE__
__FILE__
c __PRETTY_FUNCTION__
d __CLASS__
__METHOD__
c
Note: This Question is unanswered, help us to find answer for this one
Check Answer
424.
which of the following are used for code reuse?
Loops
functions
Database
include files
b,d
Note: This Question is unanswered, help us to find answer for this one
Check Answer
425.
What will be the output of the following script?
$count=50;
function Argument()
{
$count++;
echo $count;
}
Argument()
?>
It will print 50
It will print 51
It will print 52
It will print 1
d
Note: This Question is unanswered, help us to find answer for this one
Check Answer
426.
Late PHP version support remote file accessing for the functions:
include()
include_once()
require_once()
All of the above
d
Note: This Question is unanswered, help us to find answer for this one
Check Answer
427.
Which one is correct?
$s = fwrite (“a string here”);
$s = fwrite ($fp,”a string here”);
$s = fwrite (“a string here”,$fp);
none of the above
b
Note: This Question is unanswered, help us to find answer for this one
Check Answer
428.
What is the output of the following code?
$a = 3;
$b = 2;
echo (int)$a/(int)$b
?>
1
1.5
2
3
Eroor
b
Note: This Question is unanswered, help us to find answer for this one
Check Answer
429.
How can you hide the fact that web pages are written in PHP?
By using AddType application/X-httpd-php asp
Specify all file names without any dot and extension
By using .htaccess diretive in Apeche
All of the above
c
Note: This Question is unanswered, help us to find answer for this one
Check Answer
430.
The setrawcookie() method of setting cookies is different from PHP standard method of cookie setting as:
It does not allow expiry time to be set
It can be used only once
It does not URL-ENCODE the value on its own
It does not allow domain setting
Answer
Correct Answer:
It does not allow expiry time to be set
It can be used only once
It does not URL-ENCODE the value on its own
It does not allow domain setting
Note: This Question is unanswered, help us to find answer for this one
Check Answer
431.
How can you enable the cURL extension?
You should remove the semicolon in the front of "curl_extension" in php.ini.
Answer
Correct Answer:
You should remove the semicolon in the front of "curl_extension" in php.ini.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
432.
What is the primary difference between interfaces and abstract classes in PHP ?
Interfaces cannot have function implementations.
Answer
Correct Answer:
Interfaces cannot have function implementations.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
433.
What is PHAR?
The PHP way to distribute entire applications within a single file ("PHP Archive")
Answer
Correct Answer:
The PHP way to distribute entire applications within a single file ("PHP Archive")
Note: This Question is unanswered, help us to find answer for this one
Check Answer
434.
What is the result of the following code ? <?php $a = 1; echo $a++; $a *= 2; echo ++$a; ?>
15
Note: This Question is unanswered, help us to find answer for this one
Check Answer
435.
Which datatypes are treaded as arrays?
strings
Note: This Question is unanswered, help us to find answer for this one
Check Answer
436.
What is the output from this example? $str = "My name is O\'Connor."; echo stripslashes($str);
My name is O'Connor.
", $MessageBody);
Answer
Correct Answer:
My name is O'Connor.
", $MessageBody);
Note: This Question is unanswered, help us to find answer for this one
Check Answer
437.
What are the default header request protocols defined in PHP ?
All of these
Answer
Correct Answer:
All of these
Note: This Question is unanswered, help us to find answer for this one
Check Answer
438.
Which keyword causes a conditional loop to skip to the start of the next iteration?
continue
Note: This Question is unanswered, help us to find answer for this one
Check Answer
439.
What does this function do: function my_func($variable) { return (is_numeric($variable) && $variable % 2 == 0); }
Tests whether $variable is an even number
Answer
Correct Answer:
Tests whether $variable is an even number
Note: This Question is unanswered, help us to find answer for this one
Check Answer
440.
The comparison $a <> $b means
$a is not equal to $b
Answer
Correct Answer:
$a is not equal to $b
Note: This Question is unanswered, help us to find answer for this one
Check Answer
441.
Which variable assignment is 'by reference' in PHP ?
$value1= &$value;
Answer
Correct Answer:
$value1= &$value;
Note: This Question is unanswered, help us to find answer for this one
Check Answer
442.
The following would return? extract( array( 'sexy' => 'a', 'and' => 'b', 'i' => 'c', 'know' => 'd', 'it' => 'e' ) ); return $sexy.$and.$i.$know.$it;
abcde
Note: This Question is unanswered, help us to find answer for this one
Check Answer
443.
What is the value of $res in the following script? <?php $str = "1"; $int = 1; $res = ($str === $int); ?>
False, because the variables $str and $int are not of the same type.
Answer
Correct Answer:
False, because the variables $str and $int are not of the same type.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
444.
Which of the following will this function output: <? $father="mother"; $mother="son"; echo $$father; ?>
son
Note: This Question is unanswered, help us to find answer for this one
Check Answer
445.
$table = array("old_value"); foreach($table as $row) { $row="new_value"; } echo $table[0]; will produce:
"old_value"
Answer
Correct Answer:
"old_value"
Note: This Question is unanswered, help us to find answer for this one
Check Answer
446.
What will be the output of the following code: <?php class A {} class B {} class C extends B {} class D { function sayHello (A $argument) { echo '$argument is an instance of A'; } function sayHello (B $argument) { echo '$argument is an instance of B'; } } $d = new D(); $c = new C(); $d->sayHello($c);
PHP Fatal error
Answer
Correct Answer:
PHP Fatal error
Note: This Question is unanswered, help us to find answer for this one
Check Answer
447.
Which of the following variables is not related to file upload?
max_execution_size
Answer
Correct Answer:
max_execution_size
Note: This Question is unanswered, help us to find answer for this one
Check Answer
448.
How do you connect mysql with the use of PHP 5 new functions?
(both answers are correct)
Answer
Correct Answer:
(both answers are correct)
Note: This Question is unanswered, help us to find answer for this one
Check Answer
449.
True or false? PHP provides the goto in the latest version.
True
Note: This Question is unanswered, help us to find answer for this one
Check Answer
450.
What function in PHP allows you to find the position of the first occurrence of a substring?
strpos()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
451.
What Does OOM mean?
Object Oriented Model
Answer
Correct Answer:
Object Oriented Model
Note: This Question is unanswered, help us to find answer for this one
Check Answer
452.
Which of following functions compute the intersection of arrays with additional index check and are defined newly in PHP 5?
array_uintersect_assoc(); array_uintersect_uassoc();
Answer
Correct Answer:
array_uintersect_assoc(); array_uintersect_uassoc();
Note: This Question is unanswered, help us to find answer for this one
Check Answer
453.
What does php_strip_whitespace function return?
Returns the PHP source code in filename with PHP comments and whitespace removed.
Answer
Correct Answer:
Returns the PHP source code in filename with PHP comments and whitespace removed.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
454.
The number of parameters in setCookie function
7
Note: This Question is unanswered, help us to find answer for this one
Check Answer
455.
What will be the result of the following code ? $a = 0 or 1; $b = 0 || 1; echo "$a, $b";
0, 1
Note: This Question is unanswered, help us to find answer for this one
Check Answer
456.
What will be output of this code. function test(&$var) { $var=$var-1; return $var; } $returnVar = test(50); echo $returnVar. " is answer.";
Error message
Answer
Correct Answer:
Error message
Note: This Question is unanswered, help us to find answer for this one
Check Answer
457.
Which of the following functions is a relative ftp function new to PHP 5?
ftp_alloc()
Answer
Correct Answer:
ftp_alloc()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
458.
What is the function to report errors from mysqli functions or queries?
mysqli_report();
Answer
Correct Answer:
mysqli_report();
Note: This Question is unanswered, help us to find answer for this one
Check Answer
459.
Which function would you use to prepend one or more elements to the beginning of an array?
array_unshift()
Answer
Correct Answer:
array_unshift()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
460.
echo new stdClass == new stdClass, '-', new stdClass !== new stdClass;
1-1
Note: This Question is unanswered, help us to find answer for this one
Check Answer
461.
What will the following script output? <?php $a = array (‘a’ => 20, 1 => 36, 40); array_rand ($a); echo $a[0]; ?>
Nothing
Note: This Question is unanswered, help us to find answer for this one
Check Answer
462.
<?php abstract class Animal { function greeting() { $sound = $this->sound(); return strtoupper($sound); } function sound(); } class Dog extends Animal { function sound() { return "Woof!"; } } $dog = new Dog(); echo $dog->greeting(); ?>
Fatal error
Answer
Correct Answer:
Fatal error
Note: This Question is unanswered, help us to find answer for this one
Check Answer
463.
How do you instantiate a new object from class foo? class foo { function do_foo() { echo "Doing foo."; } }
$bar = new foo;
Answer
Correct Answer:
$bar = new foo;
Note: This Question is unanswered, help us to find answer for this one
Check Answer
464.
$a = array("pomme", "banane"); $b = array(1 => "banane", "0" => "pomme"); var_dump($a === $b); What does-it print ?
FALSE
Note: This Question is unanswered, help us to find answer for this one
Check Answer
465.
What is the output in following codes? <?php $array1 = array("a" => "green", "red", "blue"); $array2 = array("b" => "green", "yellow", "red"); $result = array_intersect($array1, $array2); print_r($result); ?>
Array ( [a] => green [0] => red )
Answer
Correct Answer:
Array ( [a] => green [0] => red )
Note: This Question is unanswered, help us to find answer for this one
Check Answer
466.
Which variable type can NOT be used as a type hint?
resource
Note: This Question is unanswered, help us to find answer for this one
Check Answer
467.
How should you filter variables before passing to header()?
PHP's doing this itself nowadays
Answer
Correct Answer:
PHP's doing this itself nowadays
Note: This Question is unanswered, help us to find answer for this one
Check Answer
468.
How do you get header information from a URL?
get_headers()
Answer
Correct Answer:
get_headers()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
469.
Which of following functions get a list of response headers sent (or ready to send)?
headers_list()
Answer
Correct Answer:
headers_list()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
470.
Which of the following functions compare the substrings of the parameters?
substr_compare()
Answer
Correct Answer:
substr_compare()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
471.
Which of the following functions set options in curl script?
curl_setopt()
Answer
Correct Answer:
curl_setopt()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
472.
The contents of an image file are stored in memory as $imString, but the original file is not available. Of the following, which uses the least amount of code and is a valid method of retrieving the dimensions of $imString?
return getimagesizefromstring($imString);
Answer
Correct Answer:
return getimagesizefromstring($imString);
Note: This Question is unanswered, help us to find answer for this one
Check Answer
473.
What is the best way to iterate and modify every element of an array using PHP 5?
foreach($array as $key => &$val) { /* ... */ }
Answer
Correct Answer:
foreach($array as $key => &$val) { /* ... */ }
Note: This Question is unanswered, help us to find answer for this one
Check Answer
474.
How to check if a directory exists?
file_exists($name);
Answer
Correct Answer:
file_exists($name);
Note: This Question is unanswered, help us to find answer for this one
Check Answer
475.
To ensure that a given object has a particular set of methods, you must provide a method list in the form of an ________ and then attach it as part of your class using the ________ keyword.
interface, implements
Answer
Correct Answer:
interface, implements
Note: This Question is unanswered, help us to find answer for this one
Check Answer
476.
How do you kill or destroy a session?
session_destroy();
Answer
Correct Answer:
session_destroy();
Note: This Question is unanswered, help us to find answer for this one
Check Answer
477.
What is the correct way to include the file "time.inc" ?
<?php include "time.inc"; ?>
Answer
Correct Answer:
<?php include "time.inc"; ?>
Note: This Question is unanswered, help us to find answer for this one
Check Answer
478.
What is output of the following code. $arr = "a"; $arr[0]="b"; echo $arr; echo $arr[0];
bb
Note: This Question is unanswered, help us to find answer for this one
Check Answer
479.
$sweet = array('1' => 'apple', '2' => 'banana'); $fruits = array('delicious' => $sweet, 'sweet' => 'strawberry'); function myprint($item, $key) { echo "$key is $item\n"; } array_walk_recursive($fruits, 'myprint'); In above code, what is the output?
[1 is apple] [2 is banana] [sweet is strawberry]
Answer
Correct Answer:
[1 is apple] [2 is banana] [sweet is strawberry]
Note: This Question is unanswered, help us to find answer for this one
Check Answer
480.
Which function can be used to rename files?
rename()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
481.
What is the difference between idate and date function?
idate function always returns an integer, but date function returns formatted date string or FALSE.
Answer
Correct Answer:
idate function always returns an integer, but date function returns formatted date string or FALSE.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
482.
Which function will list files and directories inside the specified path?
scandir()
Answer
Correct Answer:
scandir()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
483.
Which of the following functions allows you to store session data in a database?
session_set_save_handler();
Answer
Correct Answer:
session_set_save_handler();
Note: This Question is unanswered, help us to find answer for this one
Check Answer
484.
Which of the following crpto return longest hash value
sha1()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
485.
Which of the following is a php resource?
(all of these)
Answer
Correct Answer:
(all of these)
Note: This Question is unanswered, help us to find answer for this one
Check Answer
486.
Given: $email = ‘bob@example.com’; which code block will output example.com?
print substr($email, strpos($email, ‘@’) + 1);
Answer
Correct Answer:
print substr($email, strpos($email, ‘@’) + 1);
Note: This Question is unanswered, help us to find answer for this one
Check Answer
487.
How to open file in read/write mode?
$handle = fopen("http://www.example.com/", "r+");
Answer
Correct Answer:
$handle = fopen("http://www.example.com/", "r+");
Note: This Question is unanswered, help us to find answer for this one
Check Answer
488.
Which of the following function is used to display the properties of variable?
var_dump
Note: This Question is unanswered, help us to find answer for this one
Check Answer
489.
In PHP 5 >= 5.3.0, which new operator was added?
GOTO
Note: This Question is unanswered, help us to find answer for this one
Check Answer
490.
Which function would you use to append one or more elements to the end of the array?
array_push()
Answer
Correct Answer:
array_push()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
491.
Which of the lines below will output the following string: "PHP is "super easy" to use!"
echo "PHP is \"super easy\" to use!";
Answer
Correct Answer:
echo "PHP is \"super easy\" to use!";
Note: This Question is unanswered, help us to find answer for this one
Check Answer
492.
What is the primary difference between a method declared as static and a normal method?
Static methods do not provide a reference to $this
Answer
Correct Answer:
Static methods do not provide a reference to $this
Note: This Question is unanswered, help us to find answer for this one
Check Answer
493.
$text = 'He went to the school.'; echo strpbrk($text, 'w'); In the above code, what is the output?
went to the school.
Answer
Correct Answer:
went to the school.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
494.
The ____ operator is used to test if two values are identical in every way.
===
Note: This Question is unanswered, help us to find answer for this one
Check Answer
495.
What visibility level will this class property get in PHP 5? var $cool = true;
public
Note: This Question is unanswered, help us to find answer for this one
Check Answer
496.
What is the difference between $message and $$message?
Classic example of PHP’s variable variables
Answer
Correct Answer:
Classic example of PHP’s variable variables
Note: This Question is unanswered, help us to find answer for this one
Check Answer
497.
How do you make PHP use a class file without having to require or include it manually?
Define __autoload($class) magic function
Answer
Correct Answer:
Define __autoload($class) magic function
Note: This Question is unanswered, help us to find answer for this one
Check Answer
498.
Which values should be assigned to the variables $a, $b and $c in order for the following script to display the string Hello, World! <?php $string= "Hello, World!"; $a =?; $b =?; $c =?; if($a) { if($b &&!$c){ echo "Goodbye Cruel World!"; } else if(!$b &&!$c) { echo "Nothing here"; } } else { if(!$b) { if(!$a && (!$b && $c)) { echo"Hello, World!"; } else { echo"GoodbyeWorld!"; } } else { echo "Not quite."; } } ?>
False, False, True
Answer
Correct Answer:
False, False, True
Note: This Question is unanswered, help us to find answer for this one
Check Answer
499.
Which of the following functions split the string and return the array?
str_split()
Answer
Correct Answer:
str_split()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
500.
How can we delete a file using php function.
unlink
Note: This Question is unanswered, help us to find answer for this one
Check Answer
501.
Which of these functions will not result in a runtime error if the file requested does not exist or can't be opened?
include()
Answer
Correct Answer:
include()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
502.
$a = &$b; $b = 'Mary?'; print $a;
Mary?
Note: This Question is unanswered, help us to find answer for this one
Check Answer
503.
Which of the following is not related to file
fappend
Note: This Question is unanswered, help us to find answer for this one
Check Answer
504.
What is the best way to URL encode a string?
urlencode( $str )
Answer
Correct Answer:
urlencode( $str )
Note: This Question is unanswered, help us to find answer for this one
Check Answer
505.
function foobar( ) { $a = func_get_args( ); return $a[2]; } print foobar('a',1,'b',2); What would the output be?
b
Note: This Question is unanswered, help us to find answer for this one
Check Answer
506.
What is the best way of writing an IF/ELSE statement on one line?
echo ( $result ) ? "Win" : "Loss";
Answer
Correct Answer:
echo ( $result ) ? "Win" : "Loss";
Note: This Question is unanswered, help us to find answer for this one
Check Answer
507.
$file = 'sample.txt'; $current = file_get_contents($file); $current .= "Additional Info"; file_put_contents($file, $current); What is the meaning of above code?
It means that certain string of which value is 'Additional Info' is added to the end of the file named sample.txt.
Answer
Correct Answer:
It means that certain string of which value is 'Additional Info' is added to the end of the file named sample.txt.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
508.
(8 < 1 || 4 >= 4 ) will return
True
Note: This Question is unanswered, help us to find answer for this one
Check Answer
509.
Which of the following function is used to check type of array
is_array
Note: This Question is unanswered, help us to find answer for this one
Check Answer
510.
The function used to iterate over array and object.
foreach
Note: This Question is unanswered, help us to find answer for this one
Check Answer
511.
How can I identify the server IP address in PHP ?
$_SERVER['SERVER_ADDR'];
Answer
Correct Answer:
$_SERVER['SERVER_ADDR'];
Note: This Question is unanswered, help us to find answer for this one
Check Answer
512. $x = 10.88; echo (int) $x;
10
Note: This Question is unanswered, help us to find answer for this one
Check Answer
513.
( (4 >= 4 && 8 < 1) || (44 == 33 || 5 > 3) ) will return
TRUE
Note: This Question is unanswered, help us to find answer for this one
Check Answer
514.
Name of the function to check the variable type is object
is_object
Answer
Correct Answer:
is_object
Note: This Question is unanswered, help us to find answer for this one
Check Answer
515.
In mail($param1, $param2, $param3, $param4), the $param2 contains:
The subject
Answer
Correct Answer:
The subject
Note: This Question is unanswered, help us to find answer for this one
Check Answer
516.
Which subversion of PHP 5 adds short array syntax?
4
Note: This Question is unanswered, help us to find answer for this one
Check Answer
517.
What is the result of : $a = "abcd"; if(strpos('a', $a)) { return true; } else { return false; }
false
Note: This Question is unanswered, help us to find answer for this one
Check Answer
518.
What is the output for the following code? <?php $value1=5; $value2= $value1--; $value2= $value1++; echo $value2; ?>
4
Note: This Question is unanswered, help us to find answer for this one
Check Answer
519.
<?php $x = false or true; $y = false || true; var_dump($x); var_dump($y);
bool(false) bool(true)
Answer
Correct Answer:
bool(false) bool(true)
Note: This Question is unanswered, help us to find answer for this one
Check Answer
520.
What is the time complexity of a call to array_search()?
O(N)
Note: This Question is unanswered, help us to find answer for this one
Check Answer
521.
Which libraries are available for using regular expressions in PHP ?
Both of these.
Answer
Correct Answer:
Both of these.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
522.
The function checkdate() returns what data type?
Boolean
Note: This Question is unanswered, help us to find answer for this one
Check Answer
523.
$a='1'; extract( array( 'a' => '2' ) ); echo $a; outputs ...
2
Note: This Question is unanswered, help us to find answer for this one
Check Answer
524.
Which function opens an SQL ite database and creates the database if it does not exist?
sqlite_open()
Answer
Correct Answer:
sqlite_open()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
525.
Which of the following would be accepted as an argument parameter in the following function: function getEmotion(Emotion $emotion) { ... }
All of these
Answer
Correct Answer:
All of these
Note: This Question is unanswered, help us to find answer for this one
Check Answer
526.
How do you retrieve the value of a variable called "name" which has been passed from a submitted form?
$_GET["name"];
Answer
Correct Answer:
$_GET["name"];
Note: This Question is unanswered, help us to find answer for this one
Check Answer
527. What does MVC stand for?
Model View Controller
Answer
Correct Answer:
Model View Controller
Note: This Question is unanswered, help us to find answer for this one
Check Answer
528.
HTML form input needs to be validated in order to avoid:
All of these
Answer
Correct Answer:
All of these
Note: This Question is unanswered, help us to find answer for this one
Check Answer
529.
The PHP syntax is most similar to:
Perl and C
Answer
Correct Answer:
Perl and C
Note: This Question is unanswered, help us to find answer for this one
Check Answer
530.
Which PHP function do you call to begin a PHP session?
session_start();
Answer
Correct Answer:
session_start();
Note: This Question is unanswered, help us to find answer for this one
Check Answer
531.
In PHP in order to access MySQL database, use the:
mysqli_connect() function
Answer
Correct Answer:
mysqli_connect() function
Note: This Question is unanswered, help us to find answer for this one
Check Answer
532.
Include files must have the file extension ".inc"
False
Note: This Question is unanswered, help us to find answer for this one
Check Answer
533.
What is the correct way to require the file "time.inc" in a manner which will halt the script upon failure?
<?php require('time.inc'); ?>
Answer
Correct Answer:
<?php require('time.inc'); ?>
Note: This Question is unanswered, help us to find answer for this one
Check Answer
534.
What does this statement do? <?php echo b"testing string"; ?>
It will throw an error
Answer
Correct Answer:
It will throw an error
Note: This Question is unanswered, help us to find answer for this one
Check Answer
535.
For PHP version <= 5.3, how can we activate error reporting for all levels?
error_reporting(-1);
Answer
Correct Answer:
error_reporting(-1);
Note: This Question is unanswered, help us to find answer for this one
Check Answer
536.
What will be the array $b after executing this code? $a = array(1, 3, 5); $b = array(2, 4, 6); $b += $a;
$b = array(2, 4, 6)
Answer
Correct Answer:
$b = array(2, 4, 6)
Note: This Question is unanswered, help us to find answer for this one
Check Answer
537.
$i = 5; print $i++ + ++$i;
12
Note: This Question is unanswered, help us to find answer for this one
Check Answer
538.
What result? $a = "1"; $a[$a] = "2"; echo $a;
12
Note: This Question is unanswered, help us to find answer for this one
Check Answer
539.
What will this return:
$value="Hello_World";
$rt=explode("_",$value); echo $rt[0];
Hello
Note: This Question is unanswered, help us to find answer for this one
Check Answer
540.
An array in PHP is an ordered map which associates
keys to values.
Answer
Correct Answer:
keys to values.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
541.
What does this output? $pos =strpos('Atlanta', 'a');echo $pos;
3
Note: This Question is unanswered, help us to find answer for this one
Check Answer
542.
What is the correct syntax of mail() function in PHP?
mail($to,$subject,$message,$headers)
mail($from,$to,$subject,$message)
mail($to,$from,$subject,$message)
mail($to,$from,$message,$headers)
Answer
Correct Answer:
mail($to,$subject,$message,$headers)
Note: This Question is unanswered, help us to find answer for this one
Check Answer
543.
What will be the output of the following code?
<?
$a = 3;
print „$a‟;
?>
3
$a
Syntax error
None of these
Answer
Correct Answer:
None of these
Note: This Question is unanswered, help us to find answer for this one
Check Answer
544.
What is the output of the following PHP code snippet?
<?php
$var = “testing module”;
$statement = „This is a $var‟;
echo ($statement);
?>
This is a testing module
This is a $var
The code will not work, and will give syntax error.
Answer
Correct Answer:
This is a testing module
Note: This Question is unanswered, help us to find answer for this one
Check Answer
545.
Which of the following cryptographic functions in PHP returns the longest hash value?
md5()
sha1()
crc32()
All return the same hash value length.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
546.
What is the correct PHP command to use to catch any error messages within the code?
set_error(‘set_error’);
set_error_handler(‘error_handler’);
set_handler(‘set_handler’);
set_exception(‘set_exception’);
Answer
Correct Answer:
set_error_handler(‘error_handler’);
Note: This Question is unanswered, help us to find answer for this one
Check Answer
547.
Which function will suitably replace „X‟ if the size of a
file needs to be checked?
$size=X(filename);
filesize
size
sizeofFile
getSize
Note: This Question is unanswered, help us to find answer for this one
Check Answer
548.
Can php use gettext ?
Yes
Note: This Question is unanswered, help us to find answer for this one
Check Answer
549.
Does PHP 5 support exceptions?
Yes
No
Note: This Question is unanswered, help us to find answer for this one
Check Answer
550.
What will be the output of the following code?
<?
echo 5 * 6 / 2 + 2 * 3;
?>
1
20
21
23
34
Note: This Question is unanswered, help us to find answer for this one
Check Answer
551.
What is the best way to change the key without changing the value of a PHP array element?
$arr[$newkey] = $oldkey; unset($arr[$oldkey]);
$arr[$newkey] = $arr[$oldkey]; unset($arr[$oldkey]);
$newkey = $arr[$oldkey]; unset($arr[$oldkey]);
$arr[$newkey] = $oldkey.GetValue(); unset($arr[$oldkey]);
Answer
Correct Answer:
$arr[$newkey] = $arr[$oldkey]; unset($arr[$oldkey]);
Note: This Question is unanswered, help us to find answer for this one
Check Answer
552.
What is the correct line to use within the php.ini file, to specify that 128MB would be the maximum amount of memory that a script may use?
memory_limit = 128M
limit_memory = 128M
memory_limit: 128M
limit_memory: 128M
Answer
Correct Answer:
memory_limit = 128M
Note: This Question is unanswered, help us to find answer for this one
Check Answer
553.
What would occur if a fatal error was thrown in your PHP program?
The PHP program will stop executing at the point where the error occurred.
The PHP program will show a warning message and program will continue executing.
Since PHP is a scripting language so it does not have fatal error.
Nothing will happen.
Answer
Correct Answer:
The PHP program will stop executing at the point where the error occurred.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
554.
Which of the following will store order number (34) in an „OrderCookie‟?
setcookie(“OrderCookie”,34);
makeCookie(“OrderCookie”,34);
Cookie(“OrderCookie”,34);
OrderCookie(34);
Answer
Correct Answer:
setcookie(“OrderCookie”,34);
Note: This Question is unanswered, help us to find answer for this one
Check Answer
555.
Which of the following is useful for method overloading?
__call,__get,__set
_get,_set,_load
__get,__set,__load
__overload
Answer
Correct Answer:
__call,__get,__set
Note: This Question is unanswered, help us to find answer for this one
Check Answer
556.
What is the string concatenation operator in PHP?
+
||
.
|||
None of these
Note: This Question is unanswered, help us to find answer for this one
Check Answer
557.
Which function can be used to delete a file?
delete()
delete_file()
unlink()
fdelete()
file_unlink()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
558.
What function should you use to join array elements with a glue string?
join_st
implode
connect
make_array
None of these
Note: This Question is unanswered, help us to find answer for this one
Check Answer
559.
Which one of the following is not an encryption method in PHP?
crypt()
md5()
sha1()
bcrypt()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
560.
What enctype is required for file uploads to work?
multipart/form-data
multipart
file
application/octect-stream
None of these
Answer
Correct Answer:
multipart/form-data
Note: This Question is unanswered, help us to find answer for this one
Check Answer
561.
For the following code:
<?php
function Expenses()
{
function Salary()
{ }
function Loan()
{
function Balance()
{ } } }
?>
Which of the following sequence will run successfully?
Expenses();Salary();Loan();Balance();
Salary();Expenses();Loan();Balance();
Expenses();Salary();Balance();Loan();
Balance();Loan();Salary();Expenses();
Answer
Correct Answer:
Expenses();Salary();Loan();Balance();
Note: This Question is unanswered, help us to find answer for this one
Check Answer
562.
Which of the following will start a session?
session(start);
session();
session_start();
login_sesion();
Answer
Correct Answer:
session_start();
Note: This Question is unanswered, help us to find answer for this one
Check Answer
563.
What is the correct way to send a SMTP (Simple Mail Transfer Protocol) email using PHP?
s.sendmail($EmailAddress, [$MessageBody], msg.as_string())
sendmail($EmailAddress, “Subject”, $MessageBody);
mail($EmailAddress, “Subject”, $MessageBody);
Answer
Correct Answer:
mail($EmailAddress, “Subject”, $MessageBody);
Note: This Question is unanswered, help us to find answer for this one
Check Answer
564.
Which of the following is correct about Mysqli and PDO?
Mysqli provides the procedural way to access the database while PDO provides the
object oriented way.
Mysqli can only be used to access MySQL database while PDO can be used to access
any DBMS.
MySQLi prevents SQL Injection whereas PDO does not.
MySQLi is used to create prepared statements whereas PDO is not.
Answer
Correct Answer:
Mysqli can only be used to access MySQL database while PDO can be used to access
any DBMS.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
565.
What will be the output of the following code?
<?php
var_dump (3*4);
?>
int(3*4)
int(12)
3*4
12
None of the above
Note: This Question is unanswered, help us to find answer for this one
Check Answer
566.
Which of the following will print out the PHP call stack?
$e = new Exception; var_dump($e->debug());
$e = new Exception; var_dump($e->getTraceAsString());
$e = new Exception; var_dump($e->backtrace());
$e = new Exception; var_dump($e->getString());
Answer
Correct Answer:
$e = new Exception; var_dump($e->getTraceAsString());
Note: This Question is unanswered, help us to find answer for this one
Check Answer
567.
Which of the following is not a PHP magic constant?
_FUNCTION__
__TIME__
__FILE__
__NAMESPACE__
__CLASS__
Note: This Question is unanswered, help us to find answer for this one
Check Answer
568.
Which of the following variable declarations within a class is invalid in PHP?
private $type = „moderate‟;
internal $term = 3;
public $amnt = „500‟;
protected $name = „Quantas Private Limited‟;
Answer
Correct Answer:
internal $term = 3;
Note: This Question is unanswered, help us to find answer for this one
Check Answer
569.
Which of the following is true about the singleton design pattern?
A singleton pattern means that a class will only have a single method.
A singleton pattern means that a class can have only one instance object.
A singleton pattern means that a class has only a single member variable.
Singletons cannot be implemented in PHP.
Answer
Correct Answer:
A singleton pattern means that a class can have only one instance object.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
570.
Which of the following is not a file-related function in PHP?
fclose
fopen
fwrite
fgets
fappend
Note: This Question is unanswered, help us to find answer for this one
Check Answer
571.
Which of the following will check if a function exists?
function_exists()
has_function()
$a = “function to check”; if ($a ()) // then function exists
None of these
Answer
Correct Answer:
function_exists()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
572.
Which of the following is used to maintain the value of a variable over different pages?
static
global
session_register()
None of these
Answer
Correct Answer:
session_register()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
573. Which of the following methods should be used for sending an email using the variables $to, $subject, and $body?
mail($to,$subject,$body)
sendmail($to,$subject,$body)
mail(to,subject,body)
sendmail(to,subject,body)
Answer
Correct Answer:
mail($to,$subject,$body)
Note: This Question is unanswered, help us to find answer for this one
Check Answer
574.
What is the best practice for running MySQL queries in PHP? Consider the risk of SQL injection.
Use mysql_query() and variables: for example: $input = $_POST[‘user_input’]; mysql_query(“INSERT INTO table (column) VALUES (‘” . $input . “‘)”);
Use PDO prepared statements and parameterized queries: for example: $input=
$_POST[“user-input”] $stmt = $pdo->prepare(„INSERT INTO table (column)
VALUES (“:input”); $stmt->execute(array(„:input‟ => $input));
Use mysql_query() and string escaped variables: for example: $input=
$_POST[“user-input”] $input_safe = mysql_real_escape_string($input);
mysql_query(“INSERT INTO table (column) VALUES („” . $input. “„)”);
Use mysql_query() and variables with a blacklisting check: for example: $blacklist =
array(“DROP”,”INSERT”,”DELETE”); $input= $_POST[“user-input”] if
(!$array_search($blacklist))) mysql_query(“INSERT INTO table (column) VALUES
(„” . $input. “„)”);
Answer
Correct Answer:
Use PDO prepared statements and parameterized queries: for example: $input=
$_POST[“user-input”] $stmt = $pdo->prepare(„INSERT INTO table (column)
VALUES (“:input”); $stmt->execute(array(„:input‟ => $input));
Note: This Question is unanswered, help us to find answer for this one
Check Answer
575. What does the array_combine (a, b) function do?
It appends b to a
It associates all keys of a with the values of b and returns a new array
It returns a new array with all values of b added to the values of a
It doesn't exist
None of the above
Answer
Correct Answer:
It associates all keys of a with the values of b and returns a new array
Note: This Question is unanswered, help us to find answer for this one
Check Answer
576. What is the associativity of +=?
left
right
it is non-associative
Note: This Question is unanswered, help us to find answer for this one
Check Answer
577. Which fopen option opens the file for reading and writing; placing the file pointer at the beginning of the file without truncating it.
r
r+
w
W+
a
Note: This Question is unanswered, help us to find answer for this one
Check Answer
578. Is sizeof() function returns the number of elements in an array?
yes
no
Note: This Question is unanswered, help us to find answer for this one
Check Answer
579. What is empty () ?
A function
A language construct
A variable
A reference
None of the above
Answer
Correct Answer:
A language construct
Note: This Question is unanswered, help us to find answer for this one
Check Answer
580. Knowing that the output of the first echo is "2.5", what will be the output of the third echo on Unix Machine? setlocale(LC_ALL, "fr_FR"); echo (string)2.5; echo "\n"; echo (float)(string)2.5; ?>
2.5
25
2,5
2
Syntax error
Note: This Question is unanswered, help us to find answer for this one
Check Answer
581. Is the PHP float type guaranteed to be 64 bit IEEE?
yes
no
Note: This Question is unanswered, help us to find answer for this one
Check Answer
582. What will be the output of the following code? <? echo "5.0" == "5"; ?>
0
1
5.0
Syntax error
None of the above
Note: This Question is unanswered, help us to find answer for this one
Check Answer
583. What is the precedence between && and "and"?
&& is higher than "and"
"and" is higher than &&
They have the same precedence
Those operators don't exist<br><br>
Answer
Correct Answer:
&& is higher than "and"
Note: This Question is unanswered, help us to find answer for this one
Check Answer
584. What function would you use to delete a file?
delete ()
delete_file ()
unlink ()
fdelete ()
file_unlink ()
Answer
Correct Answer:
unlink ()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
585. Will the trim function strip NULL bytes?
Yes
No
Note: This Question is unanswered, help us to find answer for this one
Check Answer
586. What function will you use to remove the first element of an array?
array_remove_first_element
array_shift
array_ltrim
a[0] = nil
Answer
Correct Answer:
array_shift
Note: This Question is unanswered, help us to find answer for this one
Check Answer
587. What will be the output of the following code? <?php $s = "Hello world!"; print $s[4]; ?>
H
e
l
o
" " (a space)<br><br>
Note: This Question is unanswered, help us to find answer for this one
Check Answer
588. Which of the following is the operator with the lowest precedence?
new
and
, (comma)
=
Answer
Correct Answer:
, (comma)
Note: This Question is unanswered, help us to find answer for this one
Check Answer
589. What will be the output of the following code? <? $a = "Hello"; if (md5($a) === md5($a)) print "True"; else print "False"; ?>
True
False
Note: This Question is unanswered, help us to find answer for this one
Check Answer
590. What will be the output of the the following code?
<?
echo !!!0;
?>
1
Syntax error
0
Note: This Question is unanswered, help us to find answer for this one
Check Answer
591. What will be the output of the following code?
<?
echo false;
?>
0
false
FALSE
Nothing
Syntax error
Note: This Question is unanswered, help us to find answer for this one
Check Answer
592. With the following code, will the word Hello be displayed on screen? <? //?>Hello
yes
no
Note: This Question is unanswered, help us to find answer for this one
Check Answer
593. Which of the following is a type of array in PHP?
string
compound
callback
scalar
struct
Note: This Question is unanswered, help us to find answer for this one
Check Answer
594. What kind of regular expression does PHP include?
PCRE
Java REGEX
Ruby REGEX
None of the above
Note: This Question is unanswered, help us to find answer for this one
Check Answer
595. What does the array_unshift () function do?
It shifts an element off the beginning of array
It shifts all bits of the array to the left
It undo what array_shift does
None of the above
Answer
Correct Answer:
It shifts an element off the beginning of array
Note: This Question is unanswered, help us to find answer for this one
Check Answer
596. When comparing two arrays, what is the difference between == and === ?
== compares keys while === compares keys and values
=== also compares the order and types of the objects
=== compares the array references
They are identical
Answer
Correct Answer:
=== also compares the order and types of the objects
Note: This Question is unanswered, help us to find answer for this one
Check Answer
597. What will be the output of the following code?
<?
$a = "print";
$a ("hello");
?>
print
hello
print hello
fatal error
None of the above
Answer
Correct Answer:
fatal error
Note: This Question is unanswered, help us to find answer for this one
Check Answer
598. What is the initial value of a integer and float variable?
0
1
NULL
Any value
Note: This Question is unanswered, help us to find answer for this one
Check Answer
599. What is the output of the following code? <? $a = (1 << 0); $b = (1 << 1); echo $b | $a; ?>
0
1
2
3
8
32
Syntax error
Note: This Question is unanswered, help us to find answer for this one
Check Answer
600. password_hash() creates a new password hash using a strong one-way hashing algorithm. password_hash() is compatible with crypt(). Therefore, password hashes created by crypt() can be used with password_hash(). In the following sentence: $pass = password_hash('123456', PASSWORD_BCRYPT); echo strlen($pass); how many characters there are in the generated hash? and the hash generated is unique?
32 caracteres and the hash is unique.
60 caracteres and the hash is variable.
60 caracteres and the hash is unique.
40 caracteres and the hash is unique.
32 caracteres and the hash is variable.
Answer
Correct Answer:
60 caracteres and the hash is variable.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
601. function outputFn($a){ switch($a){ case $a>1: echo "1"; case $a===2: echo "2"'; case $a>2: echo "3"; } } outputFn(2); What's the output of the outputFn function?
123
12
Note: This Question is unanswered, help us to find answer for this one
Check Answer
602. What is the output of the following code? $foo = 'bar'; $bar = 'bar' $$foo = 'foo' echo '$foo', '$bar';
foobar
barfoo
bar bar
foo bar
Note: This Question is unanswered, help us to find answer for this one
Check Answer
603. $a = '1'; $b = &$a; $b = "2$b";
0
12
2
21
1
Note: This Question is unanswered, help us to find answer for this one
Check Answer
604. What are traits for?
Add methods to a class
Create a class that inherit from multiple classes
Create a singleton
Answer
Correct Answer:
Add methods to a class
Note: This Question is unanswered, help us to find answer for this one
Check Answer
605. What will be the values of $a and $b after the code below is executed? $a = '1'; $b = &$a; $b = "2$b";
$a = 21, $b = 21
$a = 1, $b = 2
$a = 1, $b = 21
Answer
Correct Answer:
$a = 21, $b = 21
Note: This Question is unanswered, help us to find answer for this one
Check Answer
606. Reserved keywords such as "break" and "while" can be used as variable names.
True
False
Note: This Question is unanswered, help us to find answer for this one
Check Answer
607. Which result will produce this code? class A { private $property = 1; public function getProperty() { return $this->property; } } class B extends A { protected $property = 2; public function __construct($v) { $this->property = $v; } } class C extends B { public $property = 3; } $c = new C(4); echo $c->property; echo $c->getProperty();
41
42
34
44
14
Note: This Question is unanswered, help us to find answer for this one
Check Answer
608. What will be the output of the below code ? echo “1”.print(3)+3;
6"1"1
133
61
16
Note: This Question is unanswered, help us to find answer for this one
Check Answer
609. What function should be used to escape strings for MySQL in PHP 5.5 and later?
mysqli_real_escape_string
mysqli_escape
mysql_escape_string
mysql_escape
mysql_real_escape_string
Answer
Correct Answer:
mysqli_real_escape_string
Note: This Question is unanswered, help us to find answer for this one
Check Answer
610. var_dump(0123 == 123); var_dump('0123' == 123); var_dump('0123' === 123);
false
321
true
123
0123
Note: This Question is unanswered, help us to find answer for this one
Check Answer
611. What is the new feature added in PHP 5.4.0 ?
Closures now support $this
Short array syntax has been added
Binary number format has been added
Support for traits
All above
Answer
Correct Answer:
All above
Note: This Question is unanswered, help us to find answer for this one
Check Answer
612. How to capture exception's message? Note: consider Exception $e.
$e->getErrors();
$e->getMessage();
$e->getException();
$e->error();
$e->getExceptions();
Answer
Correct Answer:
$e->getMessage();
Note: This Question is unanswered, help us to find answer for this one
Check Answer
613. Which one of the following keyword is used to inherit our subclass from a superclass?
inherit
extends
include
implements
Note: This Question is unanswered, help us to find answer for this one
Check Answer
614. What will be the output of the following code? $a$a = 1; $b$b = 2; echo "$a$a + $b$b";
$a$a$b$b
3
Error, $ cannot be used inside variable names
Answer
Correct Answer:
Error, $ cannot be used inside variable names
Note: This Question is unanswered, help us to find answer for this one
Check Answer
615. Which function will attempt to return a timestamp, in microseconds?
get_microtime()
microtime()
micrometer()
time( true )
Answer
Correct Answer:
microtime()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
616. Which of the folowing are valid float values?
4.5678
All of these
4.0
7e4
Answer
Correct Answer:
All of these
Note: This Question is unanswered, help us to find answer for this one
Check Answer
617. Which array function checks if the specified key exists in the array
array_key_exists()
arrays_key_exists()
array_keys_exists()
array_key_exist()
Answer
Correct Answer:
array_key_exists()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
618. What is the result of the following: $a = (2 == '2') ? true : false; echo $a;
syntax error
true
false
Note: This Question is unanswered, help us to find answer for this one
Check Answer
619. What is the result of the following code? $integer = 5; $string = strval($integer); var_dump($string);
none of these
int(1) 5
string(2) "5"
string(1) "5"
bool "False"
Answer
Correct Answer:
string(1) "5"
Note: This Question is unanswered, help us to find answer for this one
Check Answer
620. .......... Returns the time of sunrise for a given day / location
date.sunrise()
date-sunrise()
date_sunrise()
datesunrise()
Answer
Correct Answer:
date_sunrise()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
621. What will be the output of this: $a = true; echo (is_null($a)) ;
bool(true)
false
0
true
Note: This Question is unanswered, help us to find answer for this one
Check Answer
622. What will be the output of the following PHP code?
<?php
$fruits = array ("mango", "apple", "peach", "pear");
$fruits = asort ($fruits);
printr ($fruits);
?>
Array ( [1] => apple [0] => mango [2] => peach [3] => pear )
Array ( [1] => apple [0] => mango [3] => peach [2] => pear )
Array ( [0] => apple [1] => mango [2] => peach [3] => pear )
Answer
Correct Answer:
Array ( [1] => apple [0] => mango [2] => peach [3] => pear )
Note: This Question is unanswered, help us to find answer for this one
Check Answer
623. Which number of primitive types does PHP support?
8
9
5
6
Note: This Question is unanswered, help us to find answer for this one
Check Answer
624. file_exists() will return false when
This function returns TRUE for files inaccessible due to safe mode restrictions.
When the system clock is set behind the date of the file.
Files are larger than 50Mb.
Broken filesystem links.
Answer
Correct Answer:
Broken filesystem links.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
625. How will you find out the value of current session id?
By using: session_id()
By using: session-id()
By using: session id()
Answer
Correct Answer:
By using: session_id()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
626. What does this statement means $a === $b ?
if $a is not equal to $b
if $a is equal to $b
if $a is equal to $b, and they are of the same type.
Answer
Correct Answer:
if $a is equal to $b, and they are of the same type.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
627. Are ZIP extensions available by default in PHP 5.x ?
No
Yes
Note: This Question is unanswered, help us to find answer for this one
Check Answer
628. Which of the functions is used to sort an array in descending order?
Time's Up!
dsort()
asort()
rsort()
sort()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
629. What will be the output of the below code ? echo 4<<4;
16
64
8
44
Note: This Question is unanswered, help us to find answer for this one
Check Answer
630. What is the answer of this $a = 'b'; $b = 1; echo '$${a}';
$b
$${a}
none of this
1
$a
Note: This Question is unanswered, help us to find answer for this one
Check Answer
631. What does this display? function counter($a){ $result = ++$a++; return $result; } echo counter(5);
7
6
Error
5
Note: This Question is unanswered, help us to find answer for this one
Check Answer
632. What function should you use to check a supplied password against a password hashed using password_hash?
password_test
Call password_hash again and compare the generated hash with the stored hash
password_verify
password_confirm
verify_password
Answer
Correct Answer:
password_verify
Note: This Question is unanswered, help us to find answer for this one
Check Answer
633. What function can be used to hash a password for storage?
do_hash
get_hashed_password
password_hash
md5
hash_password
Answer
Correct Answer:
password_hash
Note: This Question is unanswered, help us to find answer for this one
Check Answer
634. What does this display: Class Obj{ public $a = 2; public function __construct($var=null){ if(!empty($var)) $this->a = $var } } $obj = new Obj(0); echo $obj->a;
2
0
Error: Invalid property
Null
Note: This Question is unanswered, help us to find answer for this one
Check Answer
635. $var = 'green'; $str = 'The apple is $var \n'; echo $str; What will be displayed ?
The apple is $var
The apple is green \n
The apple is green
The apple is $var \n
Answer
Correct Answer:
The apple is $var \n
Note: This Question is unanswered, help us to find answer for this one
Check Answer
636. What will show next code: $data = new stdClass; $data->var1 = 'word'; $data->var2 = 'text'; print_r( json_decode( json_encode($data), true ) );
stdClass Object ( [var1] => word [var2] => text )
Array ( [var1] => word [var2] => text )
{'var1': 'word', 'var2': 'text' }
Object ( [var1] => word [var2] => text )
{'var1' => 'word', 'var2' => 'text' }
Answer
Correct Answer:
Array ( [var1] => word [var2] => text )
Note: This Question is unanswered, help us to find answer for this one
Check Answer
637. What's the result of $b ? $a = 3; $b = &$a; $a = $a*4; echo $b;
12
Fatal error
4
3
Note: This Question is unanswered, help us to find answer for this one
Check Answer
638. What will the following code output? $array = array("dog","cat","pig"); $str = ""; foreach($array as $value){ $value .= $value . $str; } print_r($array);;
Array([0] => dog [1] => dogcat [2] => dogcatpig)
Array([0] => dog [1] => cat [2] => pig)
Array([0] => dogdog [1] => catcat [2] => pigpig)
Array([0] => dogdog [1] => dogdogcatcat [2] => dogdogcatcatpigpig)
Answer
Correct Answer:
Array([0] => dog [1] => cat [2] => pig)
Note: This Question is unanswered, help us to find answer for this one
Check Answer
639. What is the output of this : $a = true; var_dump($a);
true => bool
bool true
true (bool)
bool (true)
bool => true
Answer
Correct Answer:
bool (true)
Note: This Question is unanswered, help us to find answer for this one
Check Answer
640. In PHP, the die() and exit() functions do the exact same thing.
True
False
Note: This Question is unanswered, help us to find answer for this one
Check Answer
641. Which of these is a superglobal variable??
$_FILE
$_SITE
$_PHP_VERSION
$_SERVERS
$_SESSION
Answer
Correct Answer:
$_SESSION
Note: This Question is unanswered, help us to find answer for this one
Check Answer
642. Which splits a string to an array ?
strtr
strchr
str_split
str_replace
strlen
Answer
Correct Answer:
str_split
Note: This Question is unanswered, help us to find answer for this one
Check Answer
643. How you fetch this ? $connect = mysqli_connect("ip","test","pass"); msqli_query($connect,"use test"); $query = msqli_query($connect,"SELECT name FROM question");
fetch_array()
mysqli_fetch_array()
fetch()
my_fetch()
Answer
Correct Answer:
mysqli_fetch_array()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
644. How do you create an object ?
$object = new className->create;
$object = className();
$object = className()->create();
$object = new className();
Answer
Correct Answer:
$object = new className();
Note: This Question is unanswered, help us to find answer for this one
Check Answer
645. What is the name of the PHP configuration file?
php_server.conf
php.ini
php.conf
vhost.conf
Note: This Question is unanswered, help us to find answer for this one
Check Answer
646. What is the syntax to compare two values?
$a == $b
$a :: $b
$a = $b
$a : $b
$a - $b
Note: This Question is unanswered, help us to find answer for this one
Check Answer
647. How to display a string?
print
printf
show
echo
Note: This Question is unanswered, help us to find answer for this one
Check Answer
648. The values 0, "0", and FALSE are treated equally in all PHP functions.
Correct.
Incorrect.
Answer
Correct Answer:
Incorrect.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
649. What will be the output of the following PHP code if date is 24/02/2008? format('l,F,js,Y') ?>
Sunday, February 24th 2008
Sunday, 24 02 2008
Sunday, 02 24 2008
Sunday, 24th February 2008
Answer
Correct Answer:
Sunday, February 24th 2008
Note: This Question is unanswered, help us to find answer for this one
Check Answer
650. Result ?
ok'
"ok'"
ok '
ok
Note: This Question is unanswered, help us to find answer for this one
Check Answer
651. Which command allow you to display the php version through the console ?
php --help
php -v
php -version
php -a
Note: This Question is unanswered, help us to find answer for this one
Check Answer
652. ................Checks a date for numeric validity.
Verify_date
checkdate
verifydate
check_date
Answer
Correct Answer:
checkdate
Note: This Question is unanswered, help us to find answer for this one
Check Answer
653. What will this code output? $string = "1234567890234567890"; $pos = strpos($string, "2", 2); echo "The number two was found at position $pos";
The number two was found at position 11
The number two was found at position 10
The number two was found at position 1
The number two was found at position 2
Answer
Correct Answer:
The number two was found at position 10
Note: This Question is unanswered, help us to find answer for this one
Check Answer
654. What function sorts array in the ascending order?
ascendsort()
sort()
asort()
ascsort()
rsort()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
655. What will be output?
5
13
8
14
9
Note: This Question is unanswered, help us to find answer for this one
Check Answer
656. What will be the output of the following code:function foobar( $arg ){ static $a = 0; echo $arg; $a++; return $a; } echo foobar( 1 ); echo foobar( 3 );
1031
1132
1123
13
1030
Note: This Question is unanswered, help us to find answer for this one
Check Answer
657. What elements will the following script output? 'a', 1 => 'b'); var_dump ($array); ?>
0 => 'a', 1 => 'b'
It will output NULL
1 => 'b'
True => 'a', 1 => 'b'
None
Answer
Correct Answer:
It will output NULL
Note: This Question is unanswered, help us to find answer for this one
Check Answer
658. What is the purpose of this function? headers_sent()
Send the HTTP headers
Checks if / where the HTTP headers have been sent
Checks where the HTTP headers have been sent
Checks if the HTTP headers have been sent
Answer
Correct Answer:
Checks if / where the HTTP headers have been sent
Note: This Question is unanswered, help us to find answer for this one
Check Answer
659. What does the rsort() function do?
sort associative arrays in descending order, according to the value
sort arrays in descending order
sort arrays in ascending order
Answer
Correct Answer:
sort arrays in descending order
Note: This Question is unanswered, help us to find answer for this one
Check Answer
660. Which of the following statements can be used to set the time zone in individual scripts?
date_set_timezone(‘Europe/London’);
date_default_timezone_set(‘Europe/London’);
date_set_default_timezone(‘Europe/London’);
Answer
Correct Answer:
date_default_timezone_set(‘Europe/London’);
Note: This Question is unanswered, help us to find answer for this one
Check Answer
661. How to start PHP interactive console?
php -c
php -a
php -i
php --console
Note: This Question is unanswered, help us to find answer for this one
Check Answer
662. What is the difference between $name and $$name
$name is a variable and $$name is reference variable ?
$$name doesn't exist
there's no differences
Answer
Correct Answer:
$name is a variable and $$name is reference variable ?
Note: This Question is unanswered, help us to find answer for this one
Check Answer
663. Which is the php closing tag?
?>
php?>
Note: This Question is unanswered, help us to find answer for this one
Check Answer
664. If $a = 1 and $b = 2, how can you switch values of a and b, so we get $a = 2 and $b = 1?
$a = $b; $b = $a;
$a, $b = $b, a;
$c = $a; $a = $b; $b = $c;
Answer
Correct Answer:
$c = $a; $a = $b; $b = $c;
Note: This Question is unanswered, help us to find answer for this one
Check Answer
665. Which of the following is the php opening tag?
Note: This Question is unanswered, help us to find answer for this one
Check Answer
666. What the differences between Get And Posts methods ?
Get have limited size data to send for request
Post have limited size data to send for request
Answer
Correct Answer:
Get have limited size data to send for request
Note: This Question is unanswered, help us to find answer for this one
Check Answer
667. What is the default extension for PHP files
.php
.exe
.phpx
.html
Note: This Question is unanswered, help us to find answer for this one
Check Answer
668. PHP can be combined wiht html
True
Flase
Note: This Question is unanswered, help us to find answer for this one
Check Answer
669. How will you create a database using PHP and MySQL?
mysql_create_db(Database Name)
mysql_create_db("Database Name")
Answer
Correct Answer:
mysql_create_db("Database Name")
Note: This Question is unanswered, help us to find answer for this one
Check Answer
670. $_GET display parameters in the URL?
True
False
Note: This Question is unanswered, help us to find answer for this one
Check Answer
671. What is the correct way to join strings in php? $str = "abcdef" + "ghi"; $str = "abcdef" . "ghi"; $str = join("abcdef","ghi"); $str = "abcdef" plus "ghi"
$str = "abcdef" plus "ghi"
$str = "abcdef" . "ghi";
$str = "abcdef" + "ghi";
$str = join("abcdef","ghi");
Answer
Correct Answer:
$str = "abcdef" . "ghi";
Note: This Question is unanswered, help us to find answer for this one
Check Answer
672. Use of ===
Returns true if $x is equal to $y
Returns true if $x is equal to $y, and they are of the same type
Returns false if $x is equal to $y
Returns false if $x is equal to $y, and they are of the same type
Answer
Correct Answer:
Returns true if $x is equal to $y, and they are of the same type
Note: This Question is unanswered, help us to find answer for this one
Check Answer
673. What does PHP stand for?
PHP: Hypertext Preprocessor
Personal Home Page
Programming Home Pages
Answer
Correct Answer:
PHP: Hypertext Preprocessor
Note: This Question is unanswered, help us to find answer for this one
Check Answer
674. What is the difference between public, protected and private in a class definition?
Public makes a class member available to "everyone", protected makes the class member available to only itself and derived classes, private makes the class member only available to the class itself.
Public and static works only for methods, protected and private - only for class properties.
Wrong list, should be public, available for everyone, and private, available only inside a class.
Public can be accessed by its name, protected - only with using $this, and private can't be accessed from outside the class.
Answer
Correct Answer:
Public makes a class member available to "everyone", protected makes the class member available to only itself and derived classes, private makes the class member only available to the class itself.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
675. Output of following code:
5
2
12
"Hello world!"
10
Note: This Question is unanswered, help us to find answer for this one
Check Answer
676. What does the in_array() function in PHP do?
Checks if a variable contains an array
Checks if a value exists in an array
Return the values from a single column in the input array
None of the above
Checks if a key exists in an array
Answer
Correct Answer:
Checks if a value exists in an array
Note: This Question is unanswered, help us to find answer for this one
Check Answer
677. Which modifier you should use in function date() to get difference to Greenwich time (GMT) in hours?
E
O
Z
P
T
Note: This Question is unanswered, help us to find answer for this one
Check Answer
678. What will be the output of <?php echo strrpos('Hello world!', 'o'); ?>?
5
-5
7
4
8
Note: This Question is unanswered, help us to find answer for this one
Check Answer
679. What is the preferred way to write this if statement, and why?
if( $someVar = 5 )
if( 5 == $someVar ) and if( $someVar == 5 )
(5 == $someVar)
if $someVar == 5
Answer
Correct Answer:
if( 5 == $someVar ) and if( $someVar == 5 )
Note: This Question is unanswered, help us to find answer for this one
Check Answer
680. What is the cause of this warning: 'Warning: Cannot modify header information - headers already sent'?
body data was sent, causing headers to be sent too.
many headers sent in one time
headers are incorrect
Answer
Correct Answer:
body data was sent, causing headers to be sent too.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
681. What will be the output of , if the page was accessed via "https://example.com/?section=predef_vars&category=_server&page=request_uri#content"?
example.com/?section=predef_vars&category=_server&page=request_uri
/?section=predef_vars&category=_server&page=request_uri
/?section=predef_vars&category=_server&page=request_uri#content
/predef_vars/_server/request_uri
Answer
Correct Answer:
/?section=predef_vars&category=_server&page=request_uri
Note: This Question is unanswered, help us to find answer for this one
Check Answer
682. Which is not a magic function in PHP?
__toString()
__toNumber()
__wakeup()
__call()
Answer
Correct Answer:
__toNumber()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
683. Is it possible to initiate abstract class?
Calling constructor
Through implemented class
YES
During complie time
Answer
Correct Answer:
Through implemented class
Note: This Question is unanswered, help us to find answer for this one
Check Answer
684. What the result of the following code: function cube($n) { return($n * $n * $n); } $a = array(1, 2, 3, 4, 5); $b = array_map("cube", $a); print_r($b);
'1*8*27*64*125'
Array ( [0] => 1 [1] => 8 [2] => 27 [3] => 64 [4] => 125 )
Array ( [1] => 1 [8] => 8 [27] => 27 [64] => 64 [125] => 125 )
Answer
Correct Answer:
Array ( [0] => 1 [1] => 8 [2] => 27 [3] => 64 [4] => 125 )
Note: This Question is unanswered, help us to find answer for this one
Check Answer
685. Which function makes keys from array to become values and values from array to become keys?
array_flip
array_combine
array_reverse
Answer
Correct Answer:
array_flip
Note: This Question is unanswered, help us to find answer for this one
Check Answer
686. What does DRY stand for?
Don't remember Yonkers
Don't repeat yourself
Digitally rendered yak
Dreadful rendition of yourself
Answer
Correct Answer:
Don't repeat yourself
Note: This Question is unanswered, help us to find answer for this one
Check Answer
687. What value will be the value printed? $a = 'b'; $b = 0; echo "${$a}";
0
nothing
Note: This Question is unanswered, help us to find answer for this one
Check Answer
688. What function is used to calculate the sum of values in an array
sum_array();
get_sum();
array_sum();
sum();
Answer
Correct Answer:
array_sum();
Note: This Question is unanswered, help us to find answer for this one
Check Answer
689. What function is used to insert one or more elements to the end of an array.
insert_array();
push_array();
array_insert();
array_push();
Answer
Correct Answer:
array_push();
Note: This Question is unanswered, help us to find answer for this one
Check Answer
690. Use of Unlink()
Remove link from user field
Not a php function
Delete file from filesystem
Call link
Answer
Correct Answer:
Delete file from filesystem
Note: This Question is unanswered, help us to find answer for this one
Check Answer
691. What function in PHP to display?
readln
echo
writeln
Note: This Question is unanswered, help us to find answer for this one
Check Answer
692. What is the end tag in PHP
GET
echo
<?php
?>
$
Note: This Question is unanswered, help us to find answer for this one
Check Answer
693. $array1 = array('blue' => 1, 'red' => 2, 'green' => 3, 'purple' => 4); $array2 = array('green' => 5, 'blue' => 6, 'yellow' => 7, 'cyan' => 8); var_dump(array_diff_key($array1, $array2));
array(2) { [int(2)]=>"red" [int(4)]=>"purple" }
array(2) { ["red"]=>int(2) ["purple"]=>int(4) }
Answer
Correct Answer:
array(2) { ["red"]=>int(2) ["purple"]=>int(4) }
Note: This Question is unanswered, help us to find answer for this one
Check Answer
694. Wich is the value returned by the preg_match function in php?
The number of coincidence of the regexp
True if match false if don't match the regexp
Answer
Correct Answer:
True if match false if don't match the regexp
Note: This Question is unanswered, help us to find answer for this one
Check Answer
695. Which keyword is used to create object of a class in PHP?
this
ob
object
new
Note: This Question is unanswered, help us to find answer for this one
Check Answer
696. What is the opening tag for PHP
<?php
?>
echo
<start>
$
Note: This Question is unanswered, help us to find answer for this one
Check Answer
697. $message vs. $$message . what is the difference
Both are same
Not valid
$message is a variable with a fixed name. $$message is a variable whose name is stored in $message.
Show error
Answer
Correct Answer:
$message is a variable with a fixed name. $$message is a variable whose name is stored in $message.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
698. What function should you use to read the contents of a file into a string?
file_get_contents()
include_once()
file_as_str()
file()
require()
Answer
Correct Answer:
file_get_contents()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
699. What is the output of these line of codes?
H:date
Have a good day!
20 x Have a good day!
x 20
Have a good day! x 20
Answer
Correct Answer:
Have a good day!
Note: This Question is unanswered, help us to find answer for this one
Check Answer
700. Does ZIP extensions available by default in PHP 5.x ?
Yes
No
Note: This Question is unanswered, help us to find answer for this one
Check Answer
701. What doesn this statement means $a === $b
if $a is equal to $b, and they are of the same type.
if $a is not equal to $b
if $a is equal to $b
Answer
Correct Answer:
if $a is equal to $b, and they are of the same type.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
702. Wich will be the result of execute the following code
File: view.php
File: test.php
Note: This Question is unanswered, help us to find answer for this one
Check Answer
703. Which PHP function reads entire file into an array?
file
readfile
file_get_contents
fgets
fopen
Note: This Question is unanswered, help us to find answer for this one
Check Answer
704. Which of the following is a predefined class in PHP?
PHP_RpcClient
ErrorFault
__PHP_Incomplete_Class
Special_Iterator
None of them
Answer
Correct Answer:
__PHP_Incomplete_Class
Note: This Question is unanswered, help us to find answer for this one
Check Answer
705. What is the output of the following code: "<?php $x = 0x22; echo <<<'END' $x END; ?>"
Syntax error
34
18
$x
0x22
Note: This Question is unanswered, help us to find answer for this one
Check Answer
706. What will the function below print when called? $value = "hello world"; function printHello($x = "hello") { $x = $value; var_dump($x); }
hello
NULL
hello world
Note: This Question is unanswered, help us to find answer for this one
Check Answer
707. The getdate() function returns
A Boolean
A string
An array
An integer
A floating-point number
Note: This Question is unanswered, help us to find answer for this one
Check Answer
708. What will the following script output?
" <?php $time = strtotime ('2004/01/01'); echo date ('H:\i:s', $time); ?>"
00:00:00
00:i:00
12:00:00
12:i:00
-1
Note: This Question is unanswered, help us to find answer for this one
Check Answer
709. <?php $x = 1; echo($x++ + ++$x + $x)*2; Which will the output be?
16
12
14
15
13
Note: This Question is unanswered, help us to find answer for this one
Check Answer
710. Which function is used to read an entire file into an array ?
fwrite
file_to_array
file
file_get_contents
fgets
Note: This Question is unanswered, help us to find answer for this one
Check Answer
711. Which PHP extension allows you to simplify converting between different calendar formats?
All of these
Julian
date/time
calendar
Note: This Question is unanswered, help us to find answer for this one
Check Answer
712. Is there a function to listen on E_ERROR (fatal) errors?
register_shutdown_function()
set_error_handler()
It's not possible
Answer
Correct Answer:
register_shutdown_function()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
713. Which of the following is not a valid PHP variable type conversion?
array to object
reference to array
string to object
object to reference
Answer
Correct Answer:
object to reference
Note: This Question is unanswered, help us to find answer for this one
Check Answer
714. Which elements can be encapsulated by namespaces?
Classes, functions and constants
Classes, functions, constants and variables
Only classes
Answer
Correct Answer:
Classes, functions and constants
Note: This Question is unanswered, help us to find answer for this one
Check Answer
715. What does this code do? namespace Hello\World;
It creates two namespaces : "Hello" and "World"
It creates one namespace : "World"
It creates two namespaces : "Hello" and "Hello\World"
It creates one namespace : "Hello\World"
It creates two namespaces : "Hello\World" and "World"
Answer
Correct Answer:
It creates two namespaces : "Hello" and "Hello\World"
Note: This Question is unanswered, help us to find answer for this one
Check Answer
716. Which function returns the size of a specified file on the FTP server?
ftp_size()
get_ftp_size()
ftp_file_size()
ftp_amount()
Answer
Correct Answer:
ftp_size()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
717. Is it possible to typehint function arguments using native types (String, Bool, Array, Int, Float, Binary...)?
All types except String
Yes, using all types
Only Array is supported
Answer
Correct Answer:
Only Array is supported
Note: This Question is unanswered, help us to find answer for this one
Check Answer
718. How do you call a static method defined by the called class from a parent class?
None of these. It is not supported in the language. Parent classes cannot access static methods defined by children.
parent::func();
self::someFunc();
$obj = new __CLASS__; $obj->func();
static::someFunc();
Answer
Correct Answer:
static::someFunc();
Note: This Question is unanswered, help us to find answer for this one
Check Answer
719. $a = array('z','x','y'); $b = sort($a); The value of $b is?
array('x','y','z')
False
array('z','y','x')
True
Note: This Question is unanswered, help us to find answer for this one
Check Answer
720. What does mt_srand( [int $a] ); do?
This function does not exist
Initializes a random number generator
Returns a random string of the length specified by the first argument
Returns a random integer
Subtracts a random integer from the passed argument and returns the result
Answer
Correct Answer:
Initializes a random number generator
Note: This Question is unanswered, help us to find answer for this one
Check Answer
721. Which function would you use to obtain the ASCII value of a character?
val( );
asc( );
chr( );
ord( );
Note: This Question is unanswered, help us to find answer for this one
Check Answer
722. True or False? Within the eval() function, code must be opened and closed with PHP tags, i.e.
True, you MUST use PHP tags as everywhere
False, but you can still exit and enter PHP mode using tags
False. You can't use PHP tags with eval()
Answer
Correct Answer:
False, but you can still exit and enter PHP mode using tags
Note: This Question is unanswered, help us to find answer for this one
Check Answer
723. Which PHP function would you use to get information about the current session cookie?
set_cookie()
session_get_cookie_params()
get_cookie()
session_set_cookie_params()
Answer
Correct Answer:
session_get_cookie_params()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
724. Which function can be used to convert data into a binary string according to a specified format?
printf()
nex2bin()
pack()
encode_hex()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
725. What data types cannot be used with PHP5 Type Hinting?
Strings, Interface
Objects, Array
Integer, Strings
Integers, Array
Answer
Correct Answer:
Integer, Strings
Note: This Question is unanswered, help us to find answer for this one
Check Answer
726. What will be the output: preg_match( '@^(?:http://)?([^/]+)@i', 'http://www.php.net/index.html', $matches ); $match = $matches[1]; echo $match;
www.php.net/index.html
www.php.net
http://www.php.net/
error message
http://www.php.net/index.html
Answer
Correct Answer:
www.php.net
Note: This Question is unanswered, help us to find answer for this one
Check Answer
727. Which type of error can NOT be caught with a custom error handler?
E_USER_ERROR
E_NOTICE
E_RECOVERABLE_ERROR
E_WARNING
E_ERROR
Note: This Question is unanswered, help us to find answer for this one
Check Answer
728. Which of the following protocols is not supported by PHP streams?
bz2
imap
ssh
ftp
Note: This Question is unanswered, help us to find answer for this one
Check Answer
729. Which function returns an item from the argument list?
func_num_args()
None of these
func_get_arg()
func_get_args()
Answer
Correct Answer:
func_get_arg()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
730. Which of the following code snippets will split a string into an array with 3 elements?
$array = str_split("a b c", 2);
$array = sscanf("a b c", "%s %s %s");
$array = explode(" ", "a b c");
All of them
$array = split(" ", "a b c");
Answer
Correct Answer:
All of them
Note: This Question is unanswered, help us to find answer for this one
Check Answer
731. What does this display? 1, 'b'=>2, 'c'=>3); echo key($x);
array( 0, 1, 2 )
0
"a"
array( 'a', 'b', 'c' )
Note: This Question is unanswered, help us to find answer for this one
Check Answer
732. Which of the following network transports doesn’t PHP support?
tcp
udg
pdc
unix
Note: This Question is unanswered, help us to find answer for this one
Check Answer
733. Which of the following functions inserts one or more elements to the beginning of an array?
array_push()
array_unshift()
array_shift()
array_walk()
array_merge()
Answer
Correct Answer:
array_unshift()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
734. What is the value of $a in the following:
NULL
array( 2 )
array( 0, 1 )
array( 0, 2 )
Answer
Correct Answer:
array( 0, 1 )
Note: This Question is unanswered, help us to find answer for this one
Check Answer
735. Which PHP function will return a file's last access time?
filectime()
fileaccesstime()
fileatime()
file_access_time()
Answer
Correct Answer:
fileatime()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
736. What is the result of the following code : "<?php echo (strpos('abcdef', 'a')) ? : -1; ?>"
Syntax error
-1
0
true
1
Note: This Question is unanswered, help us to find answer for this one
Check Answer
737. What is the correct way to call an anonymous function?
$func($var);
anonymous($var);
callback($functionName, $var);
call_function($var);
Answer
Correct Answer:
$func($var);
Note: This Question is unanswered, help us to find answer for this one
Check Answer
738. is_a( $a, $b ) will:
it is not a built-in php function
check if $a is of class "$b" or has this class as one of its parents
Check if $a is of type "$b"
Answer
Correct Answer:
check if $a is of class "$b" or has this class as one of its parents
Note: This Question is unanswered, help us to find answer for this one
Check Answer
739. What is the output of the following code? $a = '12345'; $a[$a[2]] = 3; echo $a;
13345
12335
11234
12345
Note: This Question is unanswered, help us to find answer for this one
Check Answer
740. What will be the final structure of the following array? $animals = array( 'dog', 'cat', true => 'lion' );
Syntax Error will be thrown, as all keys must be of the same type
array( 0 => 'dog', 1 => 'lion' ) - boolean true will be changed to integer 1
Syntax Error will be thrown, as array keys can't be boolean values
array( 0 => 'dog', 1 => 'cat' ) - element with boolean key will be ignored
array( 0 => 'dog', 1 => 'cat', true => 'lion' )
Answer
Correct Answer:
array( 0 => 'dog', 1 => 'lion' ) - boolean true will be changed to integer 1
Note: This Question is unanswered, help us to find answer for this one
Check Answer
741. What is the output of the following code?
abcde6666666
abcde777777
abc777
777abc
abcde67
Note: This Question is unanswered, help us to find answer for this one
Check Answer
742. An object can be counted with count() and sizeof() if it:
Has a public __count() method
Was cast to an object from an array
None of the above
Implements ArrayAccess
Answer
Correct Answer:
None of the above
Note: This Question is unanswered, help us to find answer for this one
Check Answer
743. Sleep(3000); will sleep the page for?
3 seconds
30 seconds
3000 seconds
300 seconds
Answer
Correct Answer:
3000 seconds
Note: This Question is unanswered, help us to find answer for this one
Check Answer
744. What does the glob() function return?
All system global variables
An array of all global variables into the user defined function
An array of filenames / directories matching a specified pattern
Answer
Correct Answer:
An array of filenames / directories matching a specified pattern
Note: This Question is unanswered, help us to find answer for this one
Check Answer
745. Given an array of images, $images = array("img12.png", "img10.png", "img2.png", "img1.png"), which function will sort $images into ("img1.png", "img2.png", "img10.png", "img12.png")?
natsort($images);
usort($images);
asort($images);
ksort($images);
arsort($images);
Answer
Correct Answer:
natsort($images);
Note: This Question is unanswered, help us to find answer for this one
Check Answer
746. When adding ('+' function) two variables of type integer and type string, what type is the resulting value?
String
Depends on the content of the string
Integer
Note: This Question is unanswered, help us to find answer for this one
Check Answer
747. Given the following code: printVar(); ?> What will the output be?
Access HelloWorld Hi!
Access Hi!
HelloWorld Access
HelloWorld Hi!
Answer
Correct Answer:
Access Hi!
Note: This Question is unanswered, help us to find answer for this one
Check Answer
748. What is the output of the following code? $a='20'; $a -= 5; echo $a++;
Type mismatch error message
16
15
'20-5'
Note: This Question is unanswered, help us to find answer for this one
Check Answer
749. What is the result of calling json_encode() on an empty array?
{} - An empty JavaScript object
[] - An empty JavaScript array
undefined
'' - An empty JavaScript string
Answer
Correct Answer:
[] - An empty JavaScript array
Note: This Question is unanswered, help us to find answer for this one
Check Answer
750. What is the output of the following code? $one='two'; $two='one'; echo $$$one;
generates an error
two
one
does not output anything
onetwo
Note: This Question is unanswered, help us to find answer for this one
Check Answer
751. What is the default timeout of a PHP session cookie ?
30 minutes
15 minutes
Never
Depends on the client browser
Until the browser is closed
Answer
Correct Answer:
Until the browser is closed
Note: This Question is unanswered, help us to find answer for this one
Check Answer
752. Which mode parameter should be used with the fopen() function to open a file and point to the end for writing only?
c+
a
a+
w
Note: This Question is unanswered, help us to find answer for this one
Check Answer
753. Choose the correct output of: "<?php $email = 'admin@domain.tld'; echo strstr($email, '@'); ?>"
@domain.tld
admin
domain.tld
admin@domain.tld
Answer
Correct Answer:
@domain.tld
Note: This Question is unanswered, help us to find answer for this one
Check Answer
754. Which function can be used to simplify searches in databases where you know the pronunciation but not the spelling
preg_search
explode
soundex
parse_str
strtolower
Note: This Question is unanswered, help us to find answer for this one
Check Answer
755. PHP's echo and print functions are not exactly alike. Which will accept multiple parameters and concatenate them in its "without parentheses" form?
echo
both echo and print
neither echo nor print
print
Note: This Question is unanswered, help us to find answer for this one
Check Answer
756. What does the use of the final keyword in a method declaration prevent?
Child classes from overriding the method.
Specific properties within a class from being modified.
Objects from being modified.
All of these
Answer
Correct Answer:
Child classes from overriding the method.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
757. What will the following code output: array_map("print_r", array( 'a', 'b' ) );
Array{ [0] => 'a', [1] => 'b' }
a
Nothing
ab
Note: This Question is unanswered, help us to find answer for this one
Check Answer
758. use keyword is used only for namespace
true
false
Note: This Question is unanswered, help us to find answer for this one
Check Answer
759. $a = array('a' => 0, 'b' => 0, 'c' => 1, 'd' => 2); $b = array_flip($a); var_dump($b); What does the 'var_dump' function show ?
array(3) { [0]=> string(1) "b" [1]=> string(1) "c" [2]=> string(1) "d" }
array(3) { [0]=> string(1) "a" [1]=> string(1) "b" [2]=> string(1) "c" [3]=> string(1) "d" }
array(4) { 'd' => int 2 'c' => int 1 'b' => int 0 'a' => int 0}
Answer
Correct Answer:
array(3) { [0]=> string(1) "b" [1]=> string(1) "c" [2]=> string(1) "d" }
Note: This Question is unanswered, help us to find answer for this one
Check Answer
760. How do you get the number of arguments passed to a PHP function?
$argc variable
count() function
None of these
$argv variable
Answer
Correct Answer:
None of these
Note: This Question is unanswered, help us to find answer for this one
Check Answer
761. "virtual()" in PHP
marks the method as virtual, so it could be overridden
makes the final method overrideable again
is equivalent to the keyword "abstract"
is an Apache-specific function
Answer
Correct Answer:
is an Apache-specific function
Note: This Question is unanswered, help us to find answer for this one
Check Answer
762. Which of the following functions does not have a resource for a return type?
None of these
fopen()
mysql_connect()
strrpos()
Answer
Correct Answer:
strrpos()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
763. When passing an object to json_encode(), the default behavior can be modified by:
It's not possible to change the default behavior.
Implementing the JsonSerializable interface.
Defining the __toArray() function.
Defining the __toJson() function.
Answer
Correct Answer:
Implementing the JsonSerializable interface.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
764. How would you fall back on the default value of 'Unknown', if a request-parameter is missing or empty?
$name = (!empty($_GET['name'])? $_GET['name'] : ''Unknown'');
$name = (!empty($_GET['name'])? $_GET['name'] = ''Unknown'');
You can't because if 'name' is not set in the URL, it will produce an error.
$name = (empty($_GET['name'])? $_GET['name'] .= ''Unknown'');
Answer
Correct Answer:
$name = (!empty($_GET['name'])? $_GET['name'] : ''Unknown'');
Note: This Question is unanswered, help us to find answer for this one
Check Answer
765. What is the output of the following code? function luckyA (&$beebar){ $beebar *= 2; return $beebar; } $x= 4; $y = luckyA($x); $x += 5; echo $x . ', ' . $y;
13, 8
9, 8
13, 6
4, 5
Note: This Question is unanswered, help us to find answer for this one
Check Answer
766. Which of those is not magic method?
__clone
__toString
__sleep
__callStatic
__toInt
Note: This Question is unanswered, help us to find answer for this one
Check Answer
767. Which PHP function is used to replace a string?
substr_replace()
str_replace()
All of these
str_ireplace()
Answer
Correct Answer:
All of these
Note: This Question is unanswered, help us to find answer for this one
Check Answer
768. Which one of the following is the correct abstract method?
abstract protected awesomeMethod();
abstract function awesomeMethod()
protected function awesomeMethod()
abstract protected function awesomeMethod();
Answer
Correct Answer:
abstract protected function awesomeMethod();
Note: This Question is unanswered, help us to find answer for this one
Check Answer
769. print_r( 2 ) outputs:
int(2)
Array { [0] => 2 }
2
Throws an exception
Nothing, but returns false
Note: This Question is unanswered, help us to find answer for this one
Check Answer
770. Which of the following functions can be used to execute a shell command?
system();
All of these
passthru();
exec();
Answer
Correct Answer:
All of these
Note: This Question is unanswered, help us to find answer for this one
Check Answer
771. Which of these is correct usage of the chmod() function?
chmod('/path/to/file', '-rwxr-xr-x');
chmod('/path/to/file', 0x755);
chmod('/path/to/file', 0755);
chmod('/path/to/file', 755);
Answer
Correct Answer:
chmod('/path/to/file', 0755);
Note: This Question is unanswered, help us to find answer for this one
Check Answer
772. PHP variable $hello is set to “HELLO WORLD". Which statement would return "Hello World" instead?
echo ucfirst($hello);
echo ucfirst(strtolower($hello));
echo ucwords($hello);
echo ucwords(strtolower($hello));
Answer
Correct Answer:
echo ucwords(strtolower($hello));
Note: This Question is unanswered, help us to find answer for this one
Check Answer
773. class A{} class_alias( 'A', 'B' ); var_dump(new B); outputs ...
NULL
object(A)#1 (0) { }
bool(false)
object(B)#1 (0) { }
Answer
Correct Answer:
object(A)#1 (0) { }
Note: This Question is unanswered, help us to find answer for this one
Check Answer
774. What is the correct way to assign a class constant?
constant MY_CONSTANT = 'value';
const MY_CONSTANT = 'value';
private MY_CONST = 'value';
const $myConstant = 'value';
Answer
Correct Answer:
const MY_CONSTANT = 'value';
Note: This Question is unanswered, help us to find answer for this one
Check Answer
775. Which PHP function checks a month, day, and year number to determine if they form a valid Gregorian date?
verifydate()
checkdate()
verify_date()
check_date()
Answer
Correct Answer:
checkdate()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
776. What is the output of the following code? class angryBob{ public function angryBob(){ $this->apple = "Taken away by Bob"; } } class sillyBill extends angryBob{ var $apple; public function sillyBill() { $this->apple = "Eaten by Bill"; parent::angryBob(); } } $Bill = new sillyBill; echo $Bill->apple;
nothing happen
Eaten by Bill
Taken away by Bob
error message because angryBob::apple not declared
Bill is very upset
Answer
Correct Answer:
Taken away by Bob
Note: This Question is unanswered, help us to find answer for this one
Check Answer
777. What does the following PHP code do? preg_filter($pattern, $replace, $subject)
Performs a regular expression search and replace
Returns array entries that match the pattern
None of these
Performs a regular expression search and replace using a callback
Answer
Correct Answer:
Performs a regular expression search and replace
Note: This Question is unanswered, help us to find answer for this one
Check Answer
778. Which of the following is true about the "touch" function in PHP? Signature: touch($filename, $time) : boolean
$time is a required parameter of this function.
Modification timestamp is not modified, only access time (in the filesystem)
If the file does not exist, it will be created.
Answer
Correct Answer:
If the file does not exist, it will be created.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
779. PHP scripts can be saved, and included later, under which allowed file extensions?
.inc and .php
Any File Extension
.php ONLY
.inc, .common and .php
Answer
Correct Answer:
Any File Extension
Note: This Question is unanswered, help us to find answer for this one
Check Answer
780. To determine if the file pointer is at the end of a successfully opened file, use the...
feof() function.
eof() function.
$file_end variable.
$end variable.
Answer
Correct Answer:
feof() function.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
781. In PHP5, your "construct" method must be named the exact same thing as your "class".
Only on Lighttpd
True
False
When your class extends a parent class
Only on Nginx
Note: This Question is unanswered, help us to find answer for this one
Check Answer
782. Which of the following functions is used to format a number ?
format($number,$format_style);
num_format();
format_num();
format_number();
number_format();
Answer
Correct Answer:
number_format();
Note: This Question is unanswered, help us to find answer for this one
Check Answer
783. Which of the following will return TRUE?
is_numeric(M_PI)
is_null(3.14)
is_string(M_PI)
is_numeric("three point one four")
Answer
Correct Answer:
is_numeric(M_PI)
Note: This Question is unanswered, help us to find answer for this one
Check Answer
784. $_SERVER, $_COOKIE, $_FILES, $_ENV are examples of PHP built-in variables called:
global functions
superglobals
$_GLOBALS
global arrays
Answer
Correct Answer:
superglobals
Note: This Question is unanswered, help us to find answer for this one
Check Answer
785. Which PHP function will return an array of values from $start to $end.
range( $start, $end);
array_list( $start, $end);
list( $start, $end);
numbers( $start, $end);
Answer
Correct Answer:
range( $start, $end);
Note: This Question is unanswered, help us to find answer for this one
Check Answer
786. Which function is used to determine whether the variable’s value is either TRUE or FALSE?
boolean()
bool()
is_boolean()
is_bool()
Answer
Correct Answer:
is_bool()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
787. The comparison $a xor $b evaluates to...
TRUE if either $a or $b is FALSE
FALSE if either $a or $b is TRUE, but not both.
TRUE if either $a or $b is TRUE, but not both.
TRUE if either $a or $b is TRUE
Answer
Correct Answer:
TRUE if either $a or $b is TRUE, but not both.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
788. If one wants to convert all double quotes (") to a backslash followed by a double quote (\") which of the following can be used?
None of these
addslashes()
htmlspecialchars()
escape_quotes()
addbackslash()
Answer
Correct Answer:
addslashes()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
789. What function creates a cookie?
cookie()
create_cookie()
set_cookie()
setcookie()
establishcookie()
Answer
Correct Answer:
setcookie()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
790. Which function removes the first element from an array, and returns the value of the removed element?
array_flip()
array_shift()
array_compare()
array_pop()
Answer
Correct Answer:
array_shift()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
791. How can we set the default time zone using PHP?
date_default_timezone_set(timezone_identifier);
default_timezone(timezone_identifier);
timezone_set(timezone_identifier);
Answer
Correct Answer:
date_default_timezone_set(timezone_identifier);
Note: This Question is unanswered, help us to find answer for this one
Check Answer
792. What function sets the default timezone used by all date and time functions in a script?
date_default_timezone_set('Region');
default_timezone_set('Region');
date_set('Region');
timezone_set('Region');
date_default_set('Region');
Answer
Correct Answer:
date_default_timezone_set('Region');
Note: This Question is unanswered, help us to find answer for this one
Check Answer
793. What is the result of casting the integer 1 to an array: (array) 1
A numerically indexed array with one element who's value is 1
An associative array with a key of 1 and a value of 1
Casting an integer to an array has no effect
An associative array with a key of 1 and a value of NULL
Answer
Correct Answer:
A numerically indexed array with one element who's value is 1
Note: This Question is unanswered, help us to find answer for this one
Check Answer
794. What is default session time in PHP?
1800 seconds or 30 minutes.
900 seconds or 15 minutes.
1440 seconds or 24 minutes.
infinity
3600 seconds or 60 minutes.
Answer
Correct Answer:
1440 seconds or 24 minutes.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
795. The following code does what?
reads the entire file, "my_file.txt" into an array
opens the file, "my_file.txt" for reading only
opens the file, “my_file.txt” for reading and writing
Answer
Correct Answer:
opens the file, “my_file.txt” for reading and writing
Note: This Question is unanswered, help us to find answer for this one
Check Answer
796. What is input sanitization?
Removing or cleaning potentially malicious user input.
All of these
Converting input into a format that PHP supports.
The automatic process that creates the $_GET, and $_POST superglobals.
Answer
Correct Answer:
Removing or cleaning potentially malicious user input.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
797. Which PHP functions generate random numbers following algorithms known as Mersenne Twister?
mt() and smt()
mt_rand() and mt_srand()
rand() and srand()
mt_alg() and mt_salg()
Answer
Correct Answer:
mt_rand() and mt_srand()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
798. Which methods are available in PHP to read a remote file?
All of these
curl_exec()
file_get_contents()
fopen()
Answer
Correct Answer:
All of these
Note: This Question is unanswered, help us to find answer for this one
Check Answer
799. When using php cli how can you return the same info as phpinfo()
php -c 'phpinfo();'
php -I
php -i
php -a
Note: This Question is unanswered, help us to find answer for this one
Check Answer
800. What does the return code E_ERROR indicate?
Fatal run-time error
Compile-time parse error
Run-time notice
User-generated error message
Answer
Correct Answer:
Fatal run-time error
Note: This Question is unanswered, help us to find answer for this one
Check Answer
801. What function can you use to create your own streams using the PHP stream wrappers and register them within PHP?
wrapper_register
stream_wrapper_reg
stream_wrapper_register
Answer
Correct Answer:
stream_wrapper_register
Note: This Question is unanswered, help us to find answer for this one
Check Answer
802. dirname(__FILE__) will return what?
the same thing as $_SERVER['DOCUMENT_ROOT']
The directory in which the currently invoked file is located
The URL of the file it's placed in
The relative location of the server root
the current directory
Answer
Correct Answer:
The directory in which the currently invoked file is located
Note: This Question is unanswered, help us to find answer for this one
Check Answer
803. Which character is used to separate namespaces in PHP?
Period(.)
Arrow(->)
Backslash (\)
Double colon (::)
Answer
Correct Answer:
Backslash (\)
Note: This Question is unanswered, help us to find answer for this one
Check Answer
804. Which of the following string delimiting methods is known as the heredoc syntax?
delimited by <<< identifier
All of above
delimited by single quote
delimited by double quote
Answer
Correct Answer:
delimited by <<< identifier
Note: This Question is unanswered, help us to find answer for this one
Check Answer
805. Variable $a has not been declared. With error reporting turned off, what is the result of: $a[1][2]=3;?
Syntax error
A multi-level array structure is created with 3 as a value.
Error: Undeclared variable $a
Error: Uninitialized array $a[1]
Answer
Correct Answer:
A multi-level array structure is created with 3 as a value.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
806. What do anonymous functions do in PHP?
provide functions which run at the end of a script's execution
None of these
allow the creation of global functions
allow the creation of functions with no name
Answer
Correct Answer:
allow the creation of functions with no name
Note: This Question is unanswered, help us to find answer for this one
Check Answer
807. Which of the following functions allows you to split a string by a regular expression and put the results into an array?
join()
explode()
implode()
preg_split()
Answer
Correct Answer:
preg_split()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
808. Which function exchanges all keys with their associated values in an array?
array_flip(array)
array_reverse(array)
array_compare(array)
array_combine(array)
Answer
Correct Answer:
array_flip(array)
Note: This Question is unanswered, help us to find answer for this one
Check Answer
809. The PHP instruction header("Content-Type: text/plain") should be sent:
after the page is loaded.
before any output is sent
in the HTML header.
inside of a function.
Answer
Correct Answer:
before any output is sent
Note: This Question is unanswered, help us to find answer for this one
Check Answer
810. Which type of control structure should NOT be used to check for a condition being met?
switch
if /else
None of these
try / catch
Answer
Correct Answer:
try / catch
Note: This Question is unanswered, help us to find answer for this one
Check Answer
811. Which PHP function closes an open SQLite database?
close();
All of these
SQLite3Stmt::close();
sqlite_close($dbhandle);
Answer
Correct Answer:
sqlite_close($dbhandle);
Note: This Question is unanswered, help us to find answer for this one
Check Answer
812. Which function returns the contents of the output buffer and empties the buffer?
ob_get_clean();
ob_own_clean();
ob_ret_clean();
ob_return_clean();
Answer
Correct Answer:
ob_get_clean();
Note: This Question is unanswered, help us to find answer for this one
Check Answer
813. What will be displayed?
int(7)
string(1) int(7)
string(1) "6"
string(1) "6" int(7)
Answer
Correct Answer:
string(1) "6" int(7)
Note: This Question is unanswered, help us to find answer for this one
Check Answer
814. Upon completion of a file upload in PHP, the UPLOAD_ERR_OK error code is returned. What does this indicate?
The file uploaded with success.
Failed to write file to disk.
The uploaded file was only partially uploaded.
No file was uploaded.
Answer
Correct Answer:
The file uploaded with success.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
815. What variable scope would you use if you wanted a function variable which does not discard it's value when the function has completed execution?
static
None of these
function parameter
local
Note: This Question is unanswered, help us to find answer for this one
Check Answer
816. What is the result of the following code: $array[]="value";
adds new element to the array with null as a key
creates new array of chars from the given string
adds new element at the end of the array
is illegal, will throw an fatal error
Answer
Correct Answer:
adds new element at the end of the array
Note: This Question is unanswered, help us to find answer for this one
Check Answer
817. In PHP, the die() and exit() language constructs perform the same function.
False: They are not part of the PHP language
True
False: They produce different return codes
False: They are actually MySQL functions
Note: This Question is unanswered, help us to find answer for this one
Check Answer
818. Self-contained collections of functions AND properties are referred to as
collections.
elements.
objects.
references.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
819. What is the default maximum execution time for a PHP script?
60 secs
20 secs
10 secs
30 secs
Note: This Question is unanswered, help us to find answer for this one
Check Answer
820. natsort( array( "i10", "i1", "i20" ) ) = ?
false
array( "i1", "i10", "i20" )
array( "i10", "i1", "i20" )
array( "i20", "i10", "i1" )
array( "i10", "i20", "i1" )
Answer
Correct Answer:
array( "i1", "i10", "i20" )
Note: This Question is unanswered, help us to find answer for this one
Check Answer
821. Given the statement, mysqli_connect(“happy.com”, “hot24”, “015A#”, “ABC”); “happy.com” and “hot24” respectively refer to ?
Host, username
Database, host
Password, username
Host, database
Server, client
Answer
Correct Answer:
Host, username
Note: This Question is unanswered, help us to find answer for this one
Check Answer
822. What's the MIME type for images with correct extension "jpg"?
jpg
image/jpg
mime/.jpg
mime/jpg
image/jpeg
Answer
Correct Answer:
image/jpeg
Note: This Question is unanswered, help us to find answer for this one
Check Answer
823. Which PHP function tells whether a file exists and is readable?
is_readable()
read()
isset()
if_exists()
Answer
Correct Answer:
is_readable()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
824. function foo($bar) { if($bar['soap'] != 'Zest') { return $bar['soap']; } } Which best describes the function foo()?
It opens an infinite loop
The parameter(s) passed to it is/are an associative array
It is an anonymous function
It is syntactically incorrect
It will return an error
Answer
Correct Answer:
The parameter(s) passed to it is/are an associative array
Note: This Question is unanswered, help us to find answer for this one
Check Answer
825. Which of the following is the scope resolution operator in PHP?
&
.=
::
All of these
->
Note: This Question is unanswered, help us to find answer for this one
Check Answer
826. Error reporting constants are used to adjust error reporting settings. Which of the following is NOT a valid error reporting constant?
E_CONSTANT
E_NOTICE
E_ALL
E_STRICT
E_WARNING
Answer
Correct Answer:
E_CONSTANT
Note: This Question is unanswered, help us to find answer for this one
Check Answer
827. Which one removes a cookie from client's browser?
setcookie('mycookie', '', time()-3600);
unsetcookie('mycookie', 0, 1);
removecookie('mycookie', 0, time()-3600);
deletecookie($_COOKIE['mycookie']);
Answer
Correct Answer:
setcookie('mycookie', '', time()-3600);
Note: This Question is unanswered, help us to find answer for this one
Check Answer
828. Which of the following functions would allow you to convert a string to an array?
to_array()
explode()
implode()
st2arr()
expand()
Answer
Correct Answer:
explode()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
829. What is returned by array_product( array( 2, 3) )?
2
3
array( array( 2 ) )
6
array( 2 )
Note: This Question is unanswered, help us to find answer for this one
Check Answer
830. $val = ""; What will isset($val) return?
false
0
true
Note: This Question is unanswered, help us to find answer for this one
Check Answer
831. How would you delete a cookie?
do not set an expiration
use session_destroy()
eat it warmed with milk
use cookie_destroy()
set the expiration date in the past
Answer
Correct Answer:
set the expiration date in the past
Note: This Question is unanswered, help us to find answer for this one
Check Answer
832. Which PHP function removes the last value of an array and returns it?
array_last()
array_unshift()
array_pop()
array_shift()
Answer
Correct Answer:
array_pop()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
833. You can call a parent class' implementation of a method which is overridden by a child class using:
$this->
self::
above::
parent::
This is not possible
Note: This Question is unanswered, help us to find answer for this one
Check Answer
834. The break statement ends execution of which of the following structures?
while
All of these
for
switch
Answer
Correct Answer:
All of these
Note: This Question is unanswered, help us to find answer for this one
Check Answer
835. echo substr("Hello world",-4); the right output is?
world
hello
hell
orld
Note: This Question is unanswered, help us to find answer for this one
Check Answer
836. What separates a sequence of one or more characters used to specify the boundary between separate text regions?
extended value
separater
parser
delimiter
Answer
Correct Answer:
delimiter
Note: This Question is unanswered, help us to find answer for this one
Check Answer
837. Which PHP function or variable will return the value of current session id?
$_SESSION['ID']
curr_session_id()
$_SESSION['CURRENT_ID']
session_id()
Answer
Correct Answer:
session_id()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
838. Which of the following is not a valid key type for arrays in PHP?
integers
All of these
strings
objects
Note: This Question is unanswered, help us to find answer for this one
Check Answer
839. Which function displays a formatted string?
print()
printf()
echo
dump()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
840. What is the difference between the include() and require() language constructs?
There is no difference.
None of these.
They handle failure differently.
They handle file paths differently.
Answer
Correct Answer:
They handle failure differently.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
841. Which PHP function checks to see if a file exists and is writable?
if_exists()
isset()
write()
is_writable()
Answer
Correct Answer:
is_writable()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
842. The PHP mail() function allows you to...
send a mail message according to the POP3 protocol directy from a script.
None of these
send a mail message according to the IMAP protocol directly from a script.
send mail messages directly from a script.
Answer
Correct Answer:
send mail messages directly from a script.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
843. In the PHP code given below, what is/are the properties?
echo “This is an example”;
class Example
public $name;
function sample()
Answer
Correct Answer:
public $name;
Note: This Question is unanswered, help us to find answer for this one
Check Answer
844. The case expression is used as part of a PHP ____.
if statement.
switch statement.
All of these
try / catch condition.
Answer
Correct Answer:
switch statement.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
845. Which PHP function returns "true" if a value already exists in an array?
is_array()
array_key_exists()
array_found()
in_array()
array_search()
Answer
Correct Answer:
in_array()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
846. What will range('a', 'z') return?
Distance between letters 'a' and 'z' on an alphabetically ordered list
False
This function call will throw an exception
An alphabetically ordered array of letters from 'a' to 'z'
Answer
Correct Answer:
An alphabetically ordered array of letters from 'a' to 'z'
Note: This Question is unanswered, help us to find answer for this one
Check Answer
847. What does the following output? echo (5 % 3);
1
2
None of these
15
Note: This Question is unanswered, help us to find answer for this one
Check Answer
848. Choose the correct output.
98.8degrees
98
98.8
degrees
Note: This Question is unanswered, help us to find answer for this one
Check Answer
849. How do you create a non-public method, which can be used in a child-class?
protected function Something() {
preserved function Something() {
private function Something() {
parent function Something() {
nonpublic function Something() {
Answer
Correct Answer:
protected function Something() {
Note: This Question is unanswered, help us to find answer for this one
Check Answer
850. Which statement would produce the output, "I love summer"?
="I love summer"?>
All of these
Answer
Correct Answer:
All of these
Note: This Question is unanswered, help us to find answer for this one
Check Answer
851. Which rule determines which sections of script are able to access which variables?
Parameters
Variable Scope
Functions
Arrays
Answer
Correct Answer:
Variable Scope
Note: This Question is unanswered, help us to find answer for this one
Check Answer
852. What will be the result of the following: echo ucwords(strtoupper('aAaA bBbB'));
aAAA bBBB
aaaa bbbb
Aaaa Bbbb
aAaA bBbB
AAAA BBBB
Answer
Correct Answer:
AAAA BBBB
Note: This Question is unanswered, help us to find answer for this one
Check Answer
853. Which function sets the internal pointer of an array back to its first element?
reset()
current()
loop()
next()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
854. Choose the word(s) that describe the fundamental style of programming for PHP.
imperative
object-oriented
procedural
All of these
Answer
Correct Answer:
All of these
Note: This Question is unanswered, help us to find answer for this one
Check Answer
855. Is $_SERVER['PHP_SELF'] subject to injection vulnerabilities?
No, it's safe. It can only contain paths and filenames specified by the web master.
Yes, it's vulnerable. On most servers PATH_INFO is supported, which is part of PHP_SELF
Answer
Correct Answer:
Yes, it's vulnerable. On most servers PATH_INFO is supported, which is part of PHP_SELF
Note: This Question is unanswered, help us to find answer for this one
Check Answer
856. Which function advances the internal array pointer of an array?
next()
move()
current()
skip()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
857. Which variable name is incorrect?
$_1FIRST
None of the above.
$1first
$first
Note: This Question is unanswered, help us to find answer for this one
Check Answer
858. What function converts newlines to HTML line breaks in a string?
html_line_break()
nl2br()
newlines()
line_break()
insert_br()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
859. The only code construct allowed before a namespace declaration is the declare statement, for defining encoding of a source file
true
false
Note: This Question is unanswered, help us to find answer for this one
Check Answer
860. Which of the following is false?
PHP can be deployed on most web servers.
PHP can be used to develop web applications.
PHP code is embedded into HTML source code.
PHP applications must be compiled.
Answer
Correct Answer:
PHP applications must be compiled.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
861. The web server sets a cookie on the web client by sending the name/value pair as part of
a session.
an HTTP header.
a database object.
java protocol.
Answer
Correct Answer:
an HTTP header.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
862. Choose the output of the following code. Assume that today is 2009-3-19:2:45:32 pm
Mar 19, 2009
03 19, 2009
Mar 19, 09
March 19, 2009
Answer
Correct Answer:
March 19, 2009
Note: This Question is unanswered, help us to find answer for this one
Check Answer
863. In this example code, $result = print_r($a); $a is the
property
function
argument
element
Note: This Question is unanswered, help us to find answer for this one
Check Answer
864. In the date() function what does the "m" format character do?
Insert month as Jan through Dec
Insert minute as 0 through 59
Insert month as 01 through 12
Insert minute as 00 through 59
Answer
Correct Answer:
Insert month as 01 through 12
Note: This Question is unanswered, help us to find answer for this one
Check Answer
865. In PHP, you can use both single quotes and double quotes ( " " ) for strings.
False
True, but double quotes will expand PHP variables and escape sequences inside it.
True, they are the same thing.
Answer
Correct Answer:
True, but double quotes will expand PHP variables and escape sequences inside it.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
866. After a file is successfully opened in PHP, how do you retrieve a line from the file?
!feof
line_number
fgets
fpointer
Note: This Question is unanswered, help us to find answer for this one
Check Answer
867. True or False: There is no difference in using the following 2 examples: echo('string'); echo 'string';
It depends on the server environment
False
True
Note: This Question is unanswered, help us to find answer for this one
Check Answer
868. What is the scope of a PHP constant? Declared using define()
local
None of these
global
variable
Note: This Question is unanswered, help us to find answer for this one
Check Answer
869. What PHP function counts elements in an array, or properties in an object?
add()
digits()
count()
array_count()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
870. What does the following PHP statement create? define("FIRST-NAME","John");
special characters
a variable
a constant
a definition
Answer
Correct Answer:
a constant
Note: This Question is unanswered, help us to find answer for this one
Check Answer
871. Can PHP be run on a Windows IIS server?
false
Only if installed on a separate partition.
true
Note: This Question is unanswered, help us to find answer for this one
Check Answer
872. Which PHP function will combine two arrays?
array_sum()
array_merge()
array_combine()
array_push()
Answer
Correct Answer:
array_merge()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
873. What is output by the following: $c = 1; ++$c; echo $c++;
4
1
3
2
Note: This Question is unanswered, help us to find answer for this one
Check Answer
874. Which function converts a string to all uppercase characters?
uppercase()
ucase()
upper()
strtoupper()
Answer
Correct Answer:
strtoupper()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
875. Include files can have which file extensions?
.txt
.inc
Any of these
.php
Answer
Correct Answer:
Any of these
Note: This Question is unanswered, help us to find answer for this one
Check Answer
876. What is the value of $var when the following line is executed in a PHP function? unset($var);
" "
Neither of these.
NULL
Note: This Question is unanswered, help us to find answer for this one
Check Answer
877. The setcookie() function must appear _____ the <html> tag.
after
before
Note: This Question is unanswered, help us to find answer for this one
Check Answer
878. Which of the following is valid PHP syntax?
if($a == 5) then echo "a = 5"; endif
if($a == 5) echo "a = 5"; endif
None of these
if($a == 5) echo "a = 5";
Answer
Correct Answer:
if($a == 5) echo "a = 5";
Note: This Question is unanswered, help us to find answer for this one
Check Answer
879. Variables in PHP are represented by a dollar sign followed by the name of the variable. A valid name must NEVER start with a...
underscore.
Any of these.
letter.
number.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
880. What function is used to check if a variable is an array?
array()
is_array()
array_exists()
in_array()
array_check()
Answer
Correct Answer:
is_array()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
881. The FTP functions can be used to perform the following actions on file servers:
All of these
None of these.
Open a connection
Upload files
Login to a connection
Answer
Correct Answer:
All of these
Note: This Question is unanswered, help us to find answer for this one
Check Answer
882. How can we increase the execution time of a PHP script from setting php.ini?
By setting script_execution_time
By setting max_script_time
By setting max_script_execution_time
By setting max_execution_time
Answer
Correct Answer:
By setting max_execution_time
Note: This Question is unanswered, help us to find answer for this one
Check Answer
883. PHP requires instructions to be terminated at the end of each statement with a
;
</php>
}
?>
Note: This Question is unanswered, help us to find answer for this one
Check Answer
884. To suppress error messages to the user, preface the PHP statement with
%
#
!
@
Note: This Question is unanswered, help us to find answer for this one
Check Answer
885. The PHP operator, %, which returns the remainder of an equation is called the:
remainder
modulus
floating integer
pre-increment
Note: This Question is unanswered, help us to find answer for this one
Check Answer
886. Which following function is used to count total number of characters in a string?
str_count();
count();
total_chars();
num_chars();
strlen();
Answer
Correct Answer:
strlen();
Note: This Question is unanswered, help us to find answer for this one
Check Answer
887. What will be the result of this code:
Yes
No
PHP ERROR
Note: This Question is unanswered, help us to find answer for this one
Check Answer
888. If you would like to check to see if a PHP variable has data, which of the following language constructs would you use?
none().
empty().
null().
data().
Note: This Question is unanswered, help us to find answer for this one
Check Answer
889. Which of the following statement best describes: $panther = new Animal();
Access modifier
Constructor
Invocation of a function
Instantiation of a class
Declaration of a string
Answer
Correct Answer:
Instantiation of a class
Note: This Question is unanswered, help us to find answer for this one
Check Answer
890. Which is an example of a statement using a combined operator?
$a != $b
$a++
$a += $b
$a--
$a == $b
Note: This Question is unanswered, help us to find answer for this one
Check Answer
891. Which statement correctly declares a float variable in PHP?
All of these
$a = 1.234;
$a = 4.5e3;
$a = 7E-10;
Answer
Correct Answer:
All of these
Note: This Question is unanswered, help us to find answer for this one
Check Answer
892. Which function allows you to split a string into an array of substrings by a string delimiter?
split("", string)
str(" ", $str)
explode(" ", $str)
None of these
Answer
Correct Answer:
explode(" ", $str)
Note: This Question is unanswered, help us to find answer for this one
Check Answer
893. Which PHP function returns an array with elements in reverse order?
array_descend()
reverse()
array_reverse()
None of these
Answer
Correct Answer:
array_reverse()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
894. What will it output?
4
2
A error message.
3
1
Note: This Question is unanswered, help us to find answer for this one
Check Answer
895. Which of the following is the recommended standard (short_opentag=Off) for opening and closing a PHP code block?
'' to close
'' to close
'' to open and '?>' to close
'<%php' to open and '%>' to close
'=' to open and '/>' to close
Answer
Correct Answer:
'' to close
Note: This Question is unanswered, help us to find answer for this one
Check Answer
896. Which type is not supported by PHP?
array
time
boolean
integer
string
Note: This Question is unanswered, help us to find answer for this one
Check Answer
897. Which PHP function randomizes the order of the elements in an array?
mix()
reverse()
combine()
shuffle()
Answer
Correct Answer:
shuffle()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
898. Which function can be used to convert "ff" to 255?
hexdec()
bindec()
octdec()
dechex()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
899. An array in PHP is:
a data file.
None of these
a series of variables.
a collection of key value pairs.
Answer
Correct Answer:
a collection of key value pairs.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
900. What does the acronym LAMP stand for?
Linux And MySQL PHP
Linux Application in MySQL PHP
Linux Apache Monitoring Program
Linux Apache MySQL PHP (or Perl/Python)
Answer
Correct Answer:
Linux Apache MySQL PHP (or Perl/Python)
Note: This Question is unanswered, help us to find answer for this one
Check Answer
901. What is the output of flowing code?
Volvo Toyota BMW
BMW Toyota Volvo
Volvo BMW Toyota
Answer
Correct Answer:
BMW Toyota Volvo
Note: This Question is unanswered, help us to find answer for this one
Check Answer
902. Which PHP math function would you use to round a number upwards to the nearest integer?
top()
ceil()
up()
max()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
903. Which of the following is NOT used to specify PHP comments?
#
/* */
//
Note: This Question is unanswered, help us to find answer for this one
Check Answer
904. In PHP, which statement is used to retrieve browser properties?
$_SERVER['PHP_SELF']
$_SERVER['HTTP_USER_AGENT'];
$_SERVER['HTTP_HOST']
$_SERVER['SERVER_NAME']
Answer
Correct Answer:
$_SERVER['HTTP_USER_AGENT'];
Note: This Question is unanswered, help us to find answer for this one
Check Answer
905. PHP requires that instruction statements be terminated with a:
period
underscore
curly brackets
semicolon
Answer
Correct Answer:
semicolon
Note: This Question is unanswered, help us to find answer for this one
Check Answer
906. $_x = 2; $_x += 4;
-2
4
6
Error
Note: This Question is unanswered, help us to find answer for this one
Check Answer
907. Which control statement indicates a block of code to be repeated a number of times?
switch
for
include
if
Note: This Question is unanswered, help us to find answer for this one
Check Answer
908. Which statement is true regarding the XML support in PHP?
All of these
XML validation is not provided
XML parsing is provided
the PHP XML extension implements xpath
Answer
Correct Answer:
All of these
Note: This Question is unanswered, help us to find answer for this one
Check Answer
909. Select the type of variable scope which is not supported by PHP:
Function parameters
Local variables
Global variables
Hidden variables
Answer
Correct Answer:
Hidden variables
Note: This Question is unanswered, help us to find answer for this one
Check Answer
910. PHP supports which of the following features?
All of these
include files
mathematical functions
associative arrays
Answer
Correct Answer:
All of these
Note: This Question is unanswered, help us to find answer for this one
Check Answer
911. All variables in PHP start with which symbol?
@
%
$
!
Note: This Question is unanswered, help us to find answer for this one
Check Answer
912. The function mysql_connect( ) takes following parameter(s):
password
username
server
All of these
Answer
Correct Answer:
All of these
Note: This Question is unanswered, help us to find answer for this one
Check Answer
913. The PHP language can be used on the following operating systems:
Mac OS X
Windows NT
Linux
All of these
Answer
Correct Answer:
All of these
Note: This Question is unanswered, help us to find answer for this one
Check Answer
914. Which is a valid loop method in PHP?
While
All of these
Do
For
Answer
Correct Answer:
All of these
Note: This Question is unanswered, help us to find answer for this one
Check Answer
915. Which construct includes an external PHP file?
require_once
include
require
All of these
Answer
Correct Answer:
All of these
Note: This Question is unanswered, help us to find answer for this one
Check Answer
916. How do you write "Hello World" in PHP
Time's Up!
document.print("Hello World");
"Hello World";
out << "Hello World";
echo "Hello World";
Answer
Correct Answer:
echo "Hello World";
Note: This Question is unanswered, help us to find answer for this one
Check Answer
917. What types of arrays are supported in PHP?
Associative
Multi-dimensional
All of these
Numeric
Answer
Correct Answer:
All of these
Note: This Question is unanswered, help us to find answer for this one
Check Answer
918. Which function will generate random integers?
rand()
rad2deg()
search()
find()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
919. In PHP, how would you determine if a variable is set?
isinit()
isset()
unset()
combined()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
920. Which function checks for a specific PHP data type?
is_numeric()
is_float()
is_int()
All of these
Answer
Correct Answer:
All of these
Note: This Question is unanswered, help us to find answer for this one
Check Answer
921. If the allow_url_fopen configuration setting is enabled, which of the following functions will be able to open remote urls?
include()
require_once()
require()
All of these
Answer
Correct Answer:
All of these
Note: This Question is unanswered, help us to find answer for this one
Check Answer
922. Which variable is used to collect values of a form sent via the HTTP POST method?
$_POST
$POST
POST
_POST_
Note: This Question is unanswered, help us to find answer for this one
Check Answer
923. Which of the following is a valid PHP function modifier?
final
private
All of these
public
Answer
Correct Answer:
All of these
Note: This Question is unanswered, help us to find answer for this one
Check Answer
924. Choose the statement which produces this output: This is an example.
<?php echo "This is an example."; ?>
<script language="php"> print "This is an example.";</script>
<p="This is an example."; ?>
<? "This is an example."; ?>
Answer
Correct Answer:
<?php echo "This is an example."; ?>
Note: This Question is unanswered, help us to find answer for this one
Check Answer
925. Which of the following PHP language constructs allows you to combine code from one file into another?
All of the these
require_once()
require()
include()
Answer
Correct Answer:
All of the these
Note: This Question is unanswered, help us to find answer for this one
Check Answer
926. Variables in PHP start with a
ampersand(&)
underscore(_)
dollar sign($)
dot(.)
Answer
Correct Answer:
dollar sign($)
Note: This Question is unanswered, help us to find answer for this one
Check Answer
927. What are int, float, string and boolean examples of in PHP?
data types
classes
integers
pointers
Answer
Correct Answer:
data types
Note: This Question is unanswered, help us to find answer for this one
Check Answer
928. Which variable is not predefined by PHP?
$_POST
$_FILES
$_GET
$_ASK
Note: This Question is unanswered, help us to find answer for this one
Check Answer
929. One way to output a string in PHP is:
output()
display()
echo()
str()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
930. Which PHP function sorts an array?
array_alpha()
array_walk()
combine()
sort()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
931. In PHP, functions using global variables must declare the variables by using
the GLOBAL keyword.
the STATIC keyword.
the LOCAL keyword.
Answer
Correct Answer:
the GLOBAL keyword.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
932. An example of a PHP string is:
&&
10
"test"
$a
Note: This Question is unanswered, help us to find answer for this one
Check Answer
933. How do you combine multiple arrays into one single PHP array?
array_pop()
array_compare()
array_merge()
array_shift()
Answer
Correct Answer:
array_merge()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
934. CakePHP, Zend, and CodeIgniter are popular _________ used on many PHP servers.
unit testing packages
image processing libraries
cacheing tools
development frameworks
version control software
Answer
Correct Answer:
development frameworks
Note: This Question is unanswered, help us to find answer for this one
Check Answer
935. Why is PHP more widely used than ASP?
PHP is a free code to use on servers
It works on more browsers
Its cooler
Answer
Correct Answer:
PHP is a free code to use on servers
Note: This Question is unanswered, help us to find answer for this one
Check Answer
936. The logical operator OR is similar to:
||
&&
!==
!=
Note: This Question is unanswered, help us to find answer for this one
Check Answer
937. Which operator is used to concatenate strings in PHP?
dot (.)
plus (+)
ampersand (&)
logical and (and)
Note: This Question is unanswered, help us to find answer for this one
Check Answer
938. Which PHP function completely destroys all data relevant to the session?
destroy();
session_close();
session_end();
session_destroy();
Answer
Correct Answer:
session_destroy();
Note: This Question is unanswered, help us to find answer for this one
Check Answer
939. What should you do in advance, to get and set session variable
sessionstart_func()
sessionstart()
session_start()
session_start_func()
_session_start()
Answer
Correct Answer:
session_start()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
940. Which of the following function libraries are supported in PHP?
All of these
MySQL
JSON
GD
Answer
Correct Answer:
All of these
Note: This Question is unanswered, help us to find answer for this one
Check Answer
941. Which function creates a directory on the FTP server?
ftp_makekdir()
ftp_mkdir()
ftp_makedirectory()
ftp_mkdirectory()
Answer
Correct Answer:
ftp_mkdir()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
942. How do you add a multi-line comment in PHP?
<!-- This is a comment -->
*\ This is a comment \*
<comment> This is a comment </comment>
/* This is a comment */
Answer
Correct Answer:
/* This is a comment */
Note: This Question is unanswered, help us to find answer for this one
Check Answer
943. The statement header("Location: http://www.somesite.com"); will
redirects the browser to www.somesite.com.
displays the header of somesite.com.
displays the IP address of somesite.com.
creates a hyperlink.
Answer
Correct Answer:
redirects the browser to www.somesite.com.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
944. Which statement allows you to add new records to a MySQL database table?
PUT INTO
All of these
INSERT INTO
ADD INTO
Answer
Correct Answer:
INSERT INTO
Note: This Question is unanswered, help us to find answer for this one
Check Answer
945. Placing ++ in front of variable:
preincrements the variable by one
will cause a syntax error
creates a fatal error
will print as a string
Answer
Correct Answer:
preincrements the variable by one
Note: This Question is unanswered, help us to find answer for this one
Check Answer
946. Which function is used to perform a regular expression match in PHP?
match()
parse()
preg_match()
combine()
Answer
Correct Answer:
preg_match()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
947. A string literal in PHP can be specified in the following way(s):
All of these
'this is a string'
"this is a string"
<<<EOT this is a string EOT;
Answer
Correct Answer:
All of these
Note: This Question is unanswered, help us to find answer for this one
Check Answer
948. Which PHP language construct sends output to a browser window?
return
output
echo
display
Note: This Question is unanswered, help us to find answer for this one
Check Answer
949. How is the following statement interpreted in PHP? $i = 1;
$i is assigned a value of 1
$i is assigned a value of "one"
$i is being compared to 1
None of these
Answer
Correct Answer:
$i is assigned a value of 1
Note: This Question is unanswered, help us to find answer for this one
Check Answer
950. Which of the following HTML form submission methods is suitable when you need to send large amounts of form data?
Post
Get
Email
Send
Note: This Question is unanswered, help us to find answer for this one
Check Answer
951. Which of the following returns information passed via HTTP forms?
$_REQUEST
$_POST
$_GET
All of these
Answer
Correct Answer:
All of these
Note: This Question is unanswered, help us to find answer for this one
Check Answer
952. Which of the following variables is expected to contain information about the user's browser?
$_SERVER['PHP_SELF']
$_SERVER['SERVER_NAME']
$_SERVER['HTTP_VARIANT']
$_SERVER['HTTP_USER_AGENT'];
Answer
Correct Answer:
$_SERVER['HTTP_USER_AGENT'];
Note: This Question is unanswered, help us to find answer for this one
Check Answer
953. What do you need to call in order for your session variables to work?
$_SESSION_BEGIN
session_start()
session_begin()
session()
ob_start()
Answer
Correct Answer:
session_start()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
954. Which PHP function would you use to display the value of an array in a readable format?
print()
return()
print_r()
display()
Answer
Correct Answer:
print_r()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
955. What kind of error causes the termination of the script?
Fatal Errors
None of them
Notices
Warnings
Answer
Correct Answer:
Fatal Errors
Note: This Question is unanswered, help us to find answer for this one
Check Answer
956. How do you define a constant in PHP?
define("CONSTANT", "Hello world.");
constant("CONSTANT", "Hello world.");
defined("CONSTANT", "Hello world.");
eval("CONSTANT", "Hello world.");
Answer
Correct Answer:
define("CONSTANT", "Hello world.");
Note: This Question is unanswered, help us to find answer for this one
Check Answer
957. Which function gives you the current PHP version information?
version_compare()
phpversion()
version()
phpcredits()
Answer
Correct Answer:
phpversion()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
958. An example of a float in PHP is:
All of these
12.678
1.2E3
7E-10
Answer
Correct Answer:
All of these
Note: This Question is unanswered, help us to find answer for this one
Check Answer
959. Which of the following checks if a value exists in an array?
PHP does not provide any inbuilt way of doing this.
exists
in_array
exists_list
Note: This Question is unanswered, help us to find answer for this one
Check Answer
960. Which PHP function would you use to display information about variables in a simple, readable format?
dump()
infp()
display()
var_dump()
Answer
Correct Answer:
var_dump()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
961. Which PHP math function would you use to generate a random integer?
next()
rand()
random()
int()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
962. The practice of combining strings and variables into one string is called:
combination
connecting
joining
concatenation
Answer
Correct Answer:
concatenation
Note: This Question is unanswered, help us to find answer for this one
Check Answer
963. Which of the following are PHP comparison operators?
===
All of these
!=
==
Answer
Correct Answer:
All of these
Note: This Question is unanswered, help us to find answer for this one
Check Answer
964. $var = (10 % 2 == 0) ? true:false; What is the output of $var?
false
true
Note: This Question is unanswered, help us to find answer for this one
Check Answer
965. Which PHP function opens a file for reading only?
fopen("c:\\test\\time.txt" , "w");
open("c:\\test\\time.txt");
fopenr("c:\\test\\time.txt" , "r");
fopen("c:\\test\\time.txt" , "r");
Answer
Correct Answer:
fopen("c:\\test\\time.txt" , "r");
Note: This Question is unanswered, help us to find answer for this one
Check Answer
966. Which of the following are examples of PHP comments?
Both // and /* */
/* */
//
None of these
Answer
Correct Answer:
Both // and /* */
Note: This Question is unanswered, help us to find answer for this one
Check Answer
967. Which of these does not represent a single, valid PHP variable
$my-Var
$my_Var
$myVar
$myvar
Note: This Question is unanswered, help us to find answer for this one
Check Answer
968. Which statements start a session and end a session?
session_start(); unset_session();
begin_session(); end_session();
start_session(); session_explode();
session_start(); session_destroy();
start_session(); end_session();
Answer
Correct Answer:
session_start(); session_destroy();
Note: This Question is unanswered, help us to find answer for this one
Check Answer
969. Which function tests a string for an exact match of the argument?
preg_match()
regex()
test()
str()
Answer
Correct Answer:
preg_match()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
970. Which construct is typically used for exception handling in PHP?
modify()
try / catch
E_STRICT
session();
Answer
Correct Answer:
try / catch
Note: This Question is unanswered, help us to find answer for this one
Check Answer
971. To modify the default PHP settings such as whether to accept the short form open tag (<?), you need to change the
htaccess file.
php.ini file.
php.inc file.
machine.config file.
Answer
Correct Answer:
php.ini file.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
972. Which PHP function finds the position of the last occurrence of a substring within a string?
haystack()
strrpos()
split()
pos()
Answer
Correct Answer:
strrpos()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
973. Which of the following variables does PHP make automatically available to you?
$_DIR
$_UPLOADED_FILES
$_SERVER
Note: This Question is unanswered, help us to find answer for this one
Check Answer
974. Choose the correct value for $i. $i = 2; $i++;
3
2
5
4
Note: This Question is unanswered, help us to find answer for this one
Check Answer
975. What is meant by nl2br()?
Inserts HTML line breaks (<BR />) before all newlines in a string.
Inserts HTML line breaks (<P />) before all newlines in a string.
Inserts HTML line breaks (<NL/>) before all newlines in a string.
Inserts HTML line breaks (<HR />) before all newlines in a string.
Answer
Correct Answer:
Inserts HTML line breaks (<BR />) before all newlines in a string.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
976. Which of the following is NOT a command for sending output to the standard output?
print
send
echo
printf
Note: This Question is unanswered, help us to find answer for this one
Check Answer
977. In the following PHP script, $arr = array(1,2,3);, 1, 2, and 3 are the array
subscript
index
values
keys
Note: This Question is unanswered, help us to find answer for this one
Check Answer
978. Which PHP function returns part of a string?
ctrl alt delete
All of these
substr()
strpos()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
979. How to call a method from within a class?
public my_function();
private my_function();
$this->my_function();
$this.my_function();
$this( my_function() );
Answer
Correct Answer:
$this->my_function();
Note: This Question is unanswered, help us to find answer for this one
Check Answer
980. Which PHP math function would you use to return the number with the lowest value of two specified numbers?
ceil()
max()
min()
bottom()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
981. Which statement returns the number of characters in the string variable $a?
count($a)
strlen($a)
len($a)
chr($a)
sizeof($a)
Answer
Correct Answer:
strlen($a)
Note: This Question is unanswered, help us to find answer for this one
Check Answer
982. True or False : list — Assign variables as if they were an array
Yes
No
Note: This Question is unanswered, help us to find answer for this one
Check Answer
983. If a string is enclosed in double-quotes, PHP will interpret more escape sequences for special characters such as
\r
\n
\"
All of these
Answer
Correct Answer:
All of these
Note: This Question is unanswered, help us to find answer for this one
Check Answer
984. Which of these assigns a value of type string to variable $x?
$x[] = "true";
$x = "true";
$x = true;
Answer
Correct Answer:
$x = "true";
Note: This Question is unanswered, help us to find answer for this one
Check Answer
985. An Object is a/an ___ of a class
Prototype
Type
Object
Instance
Note: This Question is unanswered, help us to find answer for this one
Check Answer
986. Can PHP scripts be embedded directly into XHTML documents?
No
Yes
Depends on the Operating System
Note: This Question is unanswered, help us to find answer for this one
Check Answer
987. Which variable contains values of $_GET, $_POST, and $_COOKIE?
$_ALL
$_REQUEST
$_MERGE
$_INCLUDE
Answer
Correct Answer:
$_REQUEST
Note: This Question is unanswered, help us to find answer for this one
Check Answer
988. How do you inherit the methods from BaseClass in MyClass?
class MyClass parent BaseClass {
class MyClass extends BaseClass {
class MyClass inherits BaseClass {
class MyClass includes BaseClass {
class MyClass using BaseClass {
Answer
Correct Answer:
class MyClass extends BaseClass {
Note: This Question is unanswered, help us to find answer for this one
Check Answer
989. What is the right way to set a value on an object stdClass?
$variable.value = 'value';
$variable.['value'] = 'value';
$variable->value = 'value';
$variable['value'] = 'value';
$variable[value] = 'value';
Answer
Correct Answer:
$variable->value = 'value';
Note: This Question is unanswered, help us to find answer for this one
Check Answer
990. Which of the following is a string operator?
plus(+)
dot(.)
decrement(--)
minus(-)
Note: This Question is unanswered, help us to find answer for this one
Check Answer
991. Which function returns information on the PHP configuration you are using?
phpAll();
phpNotice();
phpinfo();
phpsearch();
phpconfig();
Answer
Correct Answer:
phpinfo();
Note: This Question is unanswered, help us to find answer for this one
Check Answer
992. How do you specify a string literal in PHP?
All of these
"Hello there"
<<<EOD Hello there EOD;
'Hello there'
Answer
Correct Answer:
All of these
Note: This Question is unanswered, help us to find answer for this one
Check Answer
993. mysqli_num_rows() function is used to:
Count number of rows in result of MySql Query.
Get all rows contain numbers.
Get all columns with numeric data.
Count number of columns in MySql Table.
Count number of characters in single row of MySql Query result.
Answer
Correct Answer:
Count number of rows in result of MySql Query.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
994. What is the official website of PHP
php.org
php.net
php.com
php.edu
php.us
Note: This Question is unanswered, help us to find answer for this one
Check Answer
995. Which of the following displays the browser properties using PHP?
$_SERVER['BROWSER_DETAIL']
$_SERVER['HTTP_AGENT']
$_SERVER['BROWSER_NAME']
$_SERVER['HTTP_USER_AGENT']
Answer
Correct Answer:
$_SERVER['HTTP_USER_AGENT']
Note: This Question is unanswered, help us to find answer for this one
Check Answer
996. What is the result of the following code?
hELLO
HELLO
hellO
None of these
hello
Note: This Question is unanswered, help us to find answer for this one
Check Answer
997. Which function allows you to specify a start position of a string and length arguments to retrieve part of a string?
substr()
chunk_split()
parse_str()
str()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
998. Which PHP function creates a directory on an FTP server?
ftp_chdir()
ftp_create_dir()
ftp_mkdir()
ftp_make_dir()
Answer
Correct Answer:
ftp_mkdir()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
999. Which function returns one or more randomly selected keys from an array?
array_rshuffle()
array_rchunk()
array_rand_pop()
array_rand()
array_diff_key()
Answer
Correct Answer:
array_rand()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
1000. How do you perform a strict comparison of variables for type and value?
$a = $b
$a === $b
None of these
$a == $b
Answer
Correct Answer:
$a === $b
Note: This Question is unanswered, help us to find answer for this one
Check Answer
1001. What type of operator is && in PHP?
arithmetic operator
comparison operator
assignment operator
logical operator
Answer
Correct Answer:
logical operator
Note: This Question is unanswered, help us to find answer for this one
Check Answer
1002. True or false? We can include ("sandy.php") two times in one PHP page "my.php".
False
True
Note: This Question is unanswered, help us to find answer for this one
Check Answer
1003. Given, the following: What is the output?
retail computer computer
retail advertising computer
retail retail retail
retail retail computer
Answer
Correct Answer:
retail advertising computer
Note: This Question is unanswered, help us to find answer for this one
Check Answer
1004. HTTP cookies can be used to:
identify a user.
create client side scripts.
validate input fields.
check for SQL injections.
Answer
Correct Answer:
identify a user.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
1005. Which statement is true about PHP constants?
They are case-sensitive by default.
They cannot be changed.
They cannot contain an array.
All of these.
Answer
Correct Answer:
All of these.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
1006. Which PHP function creates an array by using one array for keys and another for its values?
array_combine()
combine()
array2()
$array()
Answer
Correct Answer:
array_combine()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
1007. What function converts 'Hatfields & McCoys' into 'Hatfields & McCoys'?
htmlentities()
ampersand()
transform()
convert()
Answer
Correct Answer:
htmlentities()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
1008. To output information about a variable use the function
print_var()
display_var()
output()
var_dump()
Answer
Correct Answer:
var_dump()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
1009. Which of the following language constructs is used to terminate a running script?
kill()
break()
exit()
halt()
eval()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
1010. Which PHP extension provides an abstract method for database retrieval?
TRC
STMP
PDO
POP
Note: This Question is unanswered, help us to find answer for this one
Check Answer
1011. What type of statements tell your PHP script to execute a section of code only if certain criteria are met?
Function
Class
Exception
Conditional
Answer
Correct Answer:
Conditional
Note: This Question is unanswered, help us to find answer for this one
Check Answer
1012. What is the output?
syntax error
falsefalse
true
false
None of the these
Note: This Question is unanswered, help us to find answer for this one
Check Answer
1013. Which datatypes are treated as arrays in some cases?
integer
double
strings
float
Note: This Question is unanswered, help us to find answer for this one
Check Answer
1014. What is output to the screen when executing code: $> php -r
aa
PHP Parse error
truea
a
Answer
Correct Answer:
PHP Parse error
Note: This Question is unanswered, help us to find answer for this one
Check Answer
1015. Which function removes all HTML and PHP tags?
remove_html_php()
tag_remove()
remove_tags()
strip_tags()
Answer
Correct Answer:
strip_tags()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
1016. Which function allows you to delete a file?
remove
clearfile
delete
unlink
Note: This Question is unanswered, help us to find answer for this one
Check Answer
1017. What is the output from this example? $str = "My name is O\'Connor."; echo stripslashes($str);
My name is OConnor.
My name is O'Connor.
None of these
My name is O\'Connor.
Answer
Correct Answer:
My name is O'Connor.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
1018. True or False? Arrays in PHP can only hold the same data type.
True
False
Note: This Question is unanswered, help us to find answer for this one
Check Answer
1019. The ......... function parses an English textual date or time into a Unix timestamp
str_to_time()
strtodate()
strtotime()
stroftime()
Answer
Correct Answer:
strtotime()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
1020. What is a large binary data object called in PHP?
lib
blob
bin
blurb
Note: This Question is unanswered, help us to find answer for this one
Check Answer
1021. Which of the following outputs a formatted string?
printf("Hello %s", $name);
print("Hello %s", $name);
echo("Hello %s", $name);
output("Hello %s", $name);
Answer
Correct Answer:
printf("Hello %s", $name);
Note: This Question is unanswered, help us to find answer for this one
Check Answer
1022. OCI8, PostgreSQL, and SQLSRV are all examples of
queries available in PHP.
database extensions available in PHP.
form extensions available in PHP
All of these
Answer
Correct Answer:
database extensions available in PHP.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
1023. What is the result of the following code?
Array
0
2
3
Note: This Question is unanswered, help us to find answer for this one
Check Answer
1024. Which of the following functions changes directory on ftp-connection?
ftp_chmod()
ftp_login()
ftp_connect()
ftp_chdir()
ftp_mkdir()
Answer
Correct Answer:
ftp_chdir()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
1025. How do I typecast a variable to boolean?
$var = (bool)$var;
$var = ($var == $var);
Both are valid statements.
It's not possible to typecast variables like this.
Answer
Correct Answer:
$var = (bool)$var;
Note: This Question is unanswered, help us to find answer for this one
Check Answer
1026. Which PHP function sorts an array and maintains index association?
awalk()
asort()
sort()
array_alpha()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
1027. What function can be used to help prevent MySQL injection?
mysql_real_escape_string()
mysql_escape()
escape_mysql_string()
None of the above
mysqlescapethisstring()
Answer
Correct Answer:
mysql_real_escape_string()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
1028. Which function checks for the existence of a particular key?
isset()
array_key_exists()
element()
for_each()
Answer
Correct Answer:
array_key_exists()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
1029. A fatal run-time error would be caught by
E_ERROR
E_WARNING
ERROR
E_NOTICE
Note: This Question is unanswered, help us to find answer for this one
Check Answer
1030. What is a collection of characters that is treated as one entity called?
Function
Element
Parameters
String
Note: This Question is unanswered, help us to find answer for this one
Check Answer
1031. Which of the following is NOT a function of PHP session support?
session_pw
session_destroy
session_decode
session_id
Answer
Correct Answer:
session_pw
Note: This Question is unanswered, help us to find answer for this one
Check Answer
1032. What is the output of the following code?
fastest faster
fastest fastest
faster faster
faster fastest
Answer
Correct Answer:
faster fastest
Note: This Question is unanswered, help us to find answer for this one
Check Answer
1033. What is the GD Library?
It is a library that gives the PHP the capability to access and create virtual domains. - (Generated Domain)
It is a library that gives the PHP the capability to create and manipulate image files. - (Gif Draw)
it's add a dozen of special new $_GLOBAL variables that gives principally informations on the user (localization, common social media cookies, etc...) - (Global iDentification)
Answer
Correct Answer:
It is a library that gives the PHP the capability to create and manipulate image files. - (Gif Draw)
Note: This Question is unanswered, help us to find answer for this one
Check Answer
1034. Which PHP function can be used to generate a unique ID for members of your site?
mt_random()
unpack()
php_create_user()
uniqid()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
1035. How would you create a numeric array from the following string that did not include "-test" and where each digit had its own array key? $str = '6.1.4.2.6-test';
$arr = implode('-', $str); $arr = implode('.', $arr[0]);
You can't
$arr = explode('-', $str); $arr = explode('.', $arr[0]);
$arr = str_replace('-', '', $str);
Answer
Correct Answer:
$arr = explode('-', $str); $arr = explode('.', $arr[0]);
Note: This Question is unanswered, help us to find answer for this one
Check Answer
1036. The following code will produce: var_dump(5 === "5");
bool(false)
int(5)
bool(true)
string(1) "5"
Answer
Correct Answer:
bool(false)
Note: This Question is unanswered, help us to find answer for this one
Check Answer
1037. Which type of array allows you to use textual keys so that array indices can be more descriptive?
Key
Textual
Associative
All of these
Answer
Correct Answer:
Associative
Note: This Question is unanswered, help us to find answer for this one
Check Answer
1038. What is the value of $start after exiting the for loop?
2
4
3
5
1
Note: This Question is unanswered, help us to find answer for this one
Check Answer
1039. The interpreter executes one PHP command which ends in a semi-colon. This is referred to as a
PHP statement.
All of these
PHP array.
PHP function.
Answer
Correct Answer:
PHP statement.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
1040. Choose the string for which the POSIX regular expression ^[A-Za-z]$ matches.
2I
67
P
&
Note: This Question is unanswered, help us to find answer for this one
Check Answer
1041. Which of the following is not a valid PHP variable declaration?
$aVaR
${“MyVar”}
$10_var
$_10
Note: This Question is unanswered, help us to find answer for this one
Check Answer
1042. Atleast how many abstract methods must an abstract class contain?
Five
One
Two
More than two
None
Note: This Question is unanswered, help us to find answer for this one
Check Answer
1043. Which is a valid character for starting a PHP function name?
All of these
dollar sign($)
percent(%)
underscore(_)
Answer
Correct Answer:
underscore(_)
Note: This Question is unanswered, help us to find answer for this one
Check Answer
1044. Given the following code, the Atom class can access which variables? class Flash { public $fast; private $superSpeed; private $ultraSonic; protected $warp; } class Atom extends Flash { }
$fast, $warp
$fast, $superSpeed, $ultraSonic
$fast
$superSpeed, $ultraSonic
$fast, $superSpeed, $ultraSonic, $warp
Answer
Correct Answer:
$fast, $warp
Note: This Question is unanswered, help us to find answer for this one
Check Answer
1045. In this example code, $result = print_r ($a); $result is the
expression.
variable.
property.
argument.
Answer
Correct Answer:
variable.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
1046. Which statement will NOT combine strings $s1 and $s2 into a single string?
implode(' ',array($s1,$s2))
"{$s1} {$s2}"
$s1.$s2
$s1 + $s2
Answer
Correct Answer:
$s1 + $s2
Note: This Question is unanswered, help us to find answer for this one
Check Answer
1047. What is one of the difference between the use of single quotes and double quotes in PHP syntax?
single quoted strings cannot contain line breaks
variables names will not be expanded in double quotes
variable names will be expanded in double quotes
double quoted strings cannot contain line breaks
Answer
Correct Answer:
variable names will be expanded in double quotes
Note: This Question is unanswered, help us to find answer for this one
Check Answer
1048. Which PHP function checks to see if HTTP headers have been sent?
headers_sent()
sent()
http_response_code()
header()
Answer
Correct Answer:
headers_sent()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
1049. To access functions of an instantiated class, you use the following:
$class::function()
class->function()
class.function()
$class->function()
class::function
Answer
Correct Answer:
$class->function()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
1050. $table = array("old_value"); foreach($table as $row) { $row="new_value"; } echo $table[0]; will produce:
"new_value"
"old_value"
Fatal error, as the variable used in foreach is read-only
Answer
Correct Answer:
"old_value"
Note: This Question is unanswered, help us to find answer for this one
Check Answer
1051. How can you call this function? $greet = function($name) { printf("Hello %s\r\n", $name); };
$greet $World;
PHP does not support this syntax.
$greet('World');
Answer
Correct Answer:
$greet('World');
Note: This Question is unanswered, help us to find answer for this one
Check Answer
1052. The PHP function which capitalizes the first letter of each word in a string
strtoupper()
ucfirst()
caps()
ucwords()
Answer
Correct Answer:
ucwords()
Note: This Question is unanswered, help us to find answer for this one
Check Answer
1053. Which statement opens a file for writing, to append data at the end of its content ?
fopen("myFile", "wa")
fopen("myFile", "a")
fopen("myFile", "r+")
fopen("myFile", "w")
Answer
Correct Answer:
fopen("myFile", "a")
Note: This Question is unanswered, help us to find answer for this one
Check Answer
1054. What will be the output for the following code? $values = array(0, NULL, FALSE); foreach($values as $key => $value) { echo isset($values[$key]) ? "TRUE " : "FALSE "; }
FALSE FALSE FALSE
TRUE FALSE FALSE
TRUE TRUE TRUE
fatal error when using isset on an array
TRUE FALSE TRUE
Answer
Correct Answer:
TRUE FALSE TRUE
Note: This Question is unanswered, help us to find answer for this one
Check Answer
1055. What is the recommendation regarding PHP closing tags in a document?
Only use the closing tag when short tags are enabled.
End all PHP files with '?>'.
Omit the closing tag when the file contains only PHP code.
There is no recommendation.
Answer
Correct Answer:
Omit the closing tag when the file contains only PHP code.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
1056. How do single quotes interpret strings in PHP?
literally except for variables which are expanded
literally
escape sequences are interpreted
None of these
Answer
Correct Answer:
literally
Note: This Question is unanswered, help us to find answer for this one
Check Answer
1057. What function allows you to print a backtrace?
backtrace_print
print_backtrace
backtrace
debug_backtrace_print
debug_print_backtrace
Answer
Correct Answer:
debug_print_backtrace
Note: This Question is unanswered, help us to find answer for this one
Check Answer
1058. What are Traits in PHP?
Traits are class interfaces.
Traits are all of these things.
Traits allow code reuse without direct inheritance.
Traits allow multiple inheritance for classes.
Answer
Correct Answer:
Traits allow code reuse without direct inheritance.
Note: This Question is unanswered, help us to find answer for this one
Check Answer
1059. What will be the value of $result? 1, 'val2' => array('val21' => 21, 'val22' => 22), 'val3' => 3 ); $result = array_key_exists('val22', $myArr); ?>
false
" "
true
an error
Note: This Question is unanswered, help us to find answer for this one
Check Answer