1. What will be the output of the following code? <? echo 5 * 6 / 2 + 2 * 3; ?>
Answers:
- 1
- 20
- 21
- 23
- 34
Answers:
- mail($to,$subject,$body)
- sendmail($to,$subject,$body)
- mail(to,subject,body)
- sendmail(to,subject,body)
Answers:
- static
- global
- session_register()
- None of these
Answers:
- function_exists()
- has_function()
- $a = “function to check”; if ($a ()) // then function exists
- None of these
Answers:
- fclose
- fopen
- fwrite
- fgets
- fappend
Answers:
- 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.
Answers:
- <
- >
- single quote
- double quote
- &
- All of these
Answers:
- $array_variable = get_object_vars($object);
- $array_variable = (array)$object;
- $array_variable = array $object;
- $array_variable = get_object_vars $object;
Answers:
- private $type = ‘moderate’;
- internal $term = 3;
- public $amnt = ‘500’;
- protected $name = ‘Quantas Private Limited’;
Answers:
- __FUNCTION__
- __TIME__
- __FILE__
- __NAMESPACE__
- __CLASS__
Answers:
- $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());
Answers:
- int(3*4)
- int(12)
- 3*4
- 12
- None of the above
Answers:
- 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.
Answers:
- s.sendmail($EmailAddress, [$MessageBody], msg.as_string())
- sendmail($EmailAddress, “Subject”, $MessageBody);
- mail($EmailAddress, “Subject”, $MessageBody);
- <a href=”mailto:$EmailAddress”>$MessageBody</a>
Answers:
- session(start);
- session();
- session_start();
- login_sesion();
function Expenses() { function Salary() { }
function Loan() { function Balance() { } } }
?> Which of the following sequence will run successfully?
Answers:
- Expenses();Salary();Loan();Balance();
- Salary();Expenses();Loan();Balance();
- Expenses();Salary();Balance();Loan();
- Balance();Loan();Salary();Expenses();
Answers:
- multipart/form-data
- multipart
- file
- application/octect-stream
- None of these
Answers:
- crypt()
- md5()
- sha1()
- bcrypt()
Answers:
- join_st
- implode
- connect
- make_array
- None of these
20. What is the string concatenation operator in PHP?
Answers:
- +
- ||
- .
- |||
- None of these
21. Which of the following will store order number (34) in an ‘OrderCookie’?
Answers:
- setcookie(“OrderCookie”,34);
- makeCookie(“OrderCookie”,34);
- Cookie(“OrderCookie”,34);
- OrderCookie(34);
22. 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?
Answers:
- memory_limit = 128M
- limit_memory = 128M
- memory_limit: 128M
- limit_memory: 128M
Answers:
- $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]);
24. Which function can be used to delete a file?
Answers:
a. delete()
b. delete_file()
c. unlink()
d. fdelete()
e. file_unlink()
25. Which one is correct?
$count=50;
function Argument()
{
$count++;
echo $count;
}
Argument()
?>
a. delete()
b. delete_file()
c. unlink()
d. fdelete()
e. file_unlink()
25. Which one is correct?
- $s = fwrite (“a string here”);
- $s = fwrite ($fp,”a string here”);
- $s = fwrite (“a string here”,$fp);
- non of the above
- >, >=
- =,==
- !==,!==
- +=, *=
- include()
- include_once()
- require_once()
- All of the above
$count=50;
function Argument()
{
$count++;
echo $count;
}
Argument()
?>
- It will print 50
- It will print 51
- It will print 52
- It will print 1
- Loops
- functions
- Database
- include files
- Add a member varibale that gets incremented in the default constructer and decremented the destructer.
- Add a local variable that gets incremented in each constructer and decremented in the desructer
- Add a static member variable that gets incremented in each constructer and decreented in the destructor
- This cannot be accomplished since the creation of objects is being done dynamically via “new”
No comments:
Post a Comment