Académique Documents
Professionnel Documents
Culture Documents
What is the difference between GET and POST method? Correct 3. How do we submit form data without a Sumbit button? You answered: Using Javascript Incorrect Correct answer: Both a and b above i.e., using javascript and using header() 4. What happens if no file path is given in include() function? You answered: PHP continues to execute the script. Incorrect Correct answer: Include_path is made use of 5. What does explode() do? You answered: Used to convert a string to an array. Incorrect Correct answer: Used to split a string by a string 6. How do I find out the number of parameters passed into function?
8. Can we use include (test.php) two times in a PHP page test1.PHP? Correct - YES 9. In which variable is the users IP address stored?
Correct $REMOTE_ADDR
10. What is the default size of a file set in upload_max_filesize ? You answered: 2.5 MB Incorrect Correct answer: 2 MB
11. Which of the following way below is correct to comment a single line of code in php? You answered: //Commented line Incorrect Correct answer: both and b above // and # 12. How do we start a php session? Correct session_start(); 13. Can echo in php accept more than 1 parameter? Correct 14. What is the purpose of $_SESSION[]? Correct - Can store session variables 15. Can I have new lines in $subject tag of php's mail function? You answered: Yes by specifying /n Incorrect Correct answer: No 16. In mysql_fetch_array() If two or more columns of the result have the same field names, what action is taken? Correct
Used to create a persistant connection to mysql server. Used to return an identifier of an existing open connection before opening new connection.
18. What is Joomla in PHP? Correct Open source CMS 19. What is the difference between echo and print? Correct 20. ____________ function in PHP Returns a list of response headers sent (or ready to send) You answered: header()
Incorrect Correct answer: headers_list() 21. PHP supports both simple and multi-dimensional arrays Correct - YEs 22. What is array_keys() used for? Correct 23. The windows version of PHP does not have built-in support for the calendar extension Correct - False 24. Which of the following statements is FALSE for PHP Error and Logging? You answered: Both a and c below Incorrect Correct answer: trigger_error() and user_error() are different 25. Parent constructors are not called __________ if the child class defines a constructor Correct - implicitly 26. What is PHP heredoc used for? You answered: allows creating multiple lines of string with quotations Incorrect Correct answer: allows creating multiple lines of string without using quotations 27. A PHP function cannot be overloaded or redefined You answered: False Incorrect Correct answer: True 28. PHP supports explicit type definition in variable declaration. Correct 29. How do I create PHP arrays in a HTML <form>? Correct
You answered: pass the IP of the remote machine as first parameter to the COM constructor. Incorrect Correct answer: Both a and c above
like we run local objects pass the IP of the remote machine as second parameter to the COM constructor.
32. Can I run several versions of PHP at the same time? You answered: No Incorrect Correct answer: Yes
Correct - Read/Write. Creates a new file. Returns FALSE and an error if file already exists
36. What is the strpos() function used for?
MYSQL
1. What is a candidate key? Correct
Using COUNT
5. An outer join requires each record in the two joined tables to have a matching record. Correct - NO 6. How do I find out all databases starting with test to which I have access to? You answered: SHOW DATABASES LIKE 'test'%; Incorrect Correct answer: SHOW DATABASES LIKE test%; 7. Can I define multiple unique constraints on a table? Correct
Yes
8. When do we use a HAVING clause? You answered: both b and c above Incorrect Correct answer: To limit the output of a query using an aggregate function only 9. USE keyword is used to select a ___________
Correct
Database
10. Enum values are stored accodring to their index numbers Correct 11. Which of the following ways below are the correct way to get the current date? Correct
12. Which of the following file extension is a valid MyISAM file extension? You answered: .ism Incorrect Correct answer: .myd 13. User() fucntion returns the current users user name and ___________ You answered: both a and b above Incorrect Correct answer: host name 14. i-am-a-dummy flag is used Makes the MySQL engine refuse UPDATE and which other command? Correct
DELETE
15. Which is the default order of sort in ORDER BY clause? You answered: Descending Incorrect Correct answer: Ascending 16. Can DISTINCT command be used for more than one column? Correct - YES 17. On executing DELETE command, if you get an error "foreign key constraint"- what does it imply? Correct
1. What language defines the behavior of a web page? Correct 2. Which of the following is the tainted property of a window object in Java Script? You answered: Protocol Incorrect Correct answer: Defaultstatus 3. How to append a value to an array of Java Script? You answered: arr[arr.length-1] = value Incorrect Correct answer: arr[arr.length] = value 4. Why so Java and Java Script have similar name? You answered: None of the above Incorrect Correct answer: The syntax of Java is loosely based on Java syntax 5. Which machine actually executes the Java Script? You answered: Java Script engine Incorrect Correct answer: The machine which is running a web browser 6. Is it possible to declare a variable in Java Script along its type? You answered: No Incorrect
Correct answer: Yes 7. Which of the following are capable of Java Script functions? You answered: all of the above Incorrect Correct answer: Accepting parameters 8. How does Java Script store dates in objects of Date type? You answered: The number of seconds since January 1st, 1970 Incorrect Correct answer: The number of milliseconds since January 1st, 1970 9. Which attribute is used to hold the Java Script version? You answered: VERSION Incorrect Correct answer: LANGUAGE 10. Which of the following is correct to write Hello World on the web page? Correct 11. Which of the following syntax is correct to refer an external script called formValidation.js? Correct 12. What type of image maps could be used with Java Script? Correct
Incorrect Correct answer: FileUpload - client side, File- server side 18. Which of the following method is used to evaluate a string of Java Script code in the context of the specified object? Correct eval() 19. What is the event that fires when the form elements : <button>.<textarea> loses the focus? Correct onblur() 20. Which of the following is used to capture all click events in a window? You answered: window.handleEvents (Event.CLICK); Incorrect Correct answer: window.captureEvents(Event.CLICK); 21. Javascript is an object oriented language? Correct - True 22. C-style block-level scoping is not supported in Java script You answered: False Incorrect Correct answer: True 23. To insert a JavaScript into an HTML page, which tag is used? Correct - <script> 24. If we dont want the script to write page content, under which HTML tag should the JS tag be placeD? You answered: Any of a and b above Incorrect Correct answer: < body> 25. Which of the following statements are true for Java script? Correct 26. Which of the following statements are false for Java script? You answered: Both b and c above Incorrect Correct answer: Variable names are not case sensitive 27. Which of the below is used in Java script to insert special characters? Correct - \ 28. JavaScript ignores extra spaces Correct - YES
29. Which of the ways below is incorrect of instantiating a date? You answered: new Date(dateString) Incorrect Correct answer: new Date(seconds) 30. Which of the following statements are false for Java script? You answered: JavaScript can read and write HTML elements Incorrect Correct answer: JavaScript cannot be used to create cookies 31. What is negative infinity in Java script? Correct -ve/0 32. ___________ JavaScript is also called client-side JavaScript. You answered: Native Incorrect Correct answer: Navigator 33. Java script can be used for Storing the form's contents to a database file on the server You answered: True Incorrect Correct answer: False 34. Which of the following is not a valid JavaScript variable name? Correct 35. Which is the correct way to write a JavaScript array? Correct 36. File is server-side JavaScript object You answered: True Incorrect Correct answer: False 37. What java wrapper type is created when a JavaScript object is sent to Java? Correct
JSObject
38. Which attribute needs to be changed to make elements invisible? You answered: invisible Incorrect
Correct answer: visibilty 39. Java Script supports all boolean operators You answered: True Incorrect Correct answer: False 40. What is the alternate name for Java script? Correct
a) uksort() b) arsort() c) ksort() d) (your answer) All of the above - correct answer
3) Which of the following functions are used by PHP to find out what type a variable is?
a) normal b) aborted c) timeout d) (your answer) All of the above - correct answer
a) (your answer) PHP: Hypertext Preprocessor - correct answer b) Personal Home Page c) Private Home Page d) Personal Hypertext Processor
a) "Hello World"; b) (your answer) echo "Hello World"; - correct answer c) Document.Write("Hello World"); d) response.write("Hello World")
12) In PHP you can use both single quotes ( ' ' ) and double quotes ( " " ) for strings:
a) <!--include file="time.inc"--> b) <?php include_file("time.inc"); ?> c) (your answer) <?php require("time.inc"); ?> - correct answer d) <% include file="time.inc" %>
a) (your answer) function myFunction() - correct answer b) new_function myFunction() c) create myFunction()
20) Which of the following regular expressions will match the string no.no.no?
22) What can you use to replace like with hate in I like Eminem?
a) preg_replace("like", "hate", "I like Eminem") - correct answer b) (your answer) preg_replace("/like/", "hate", "I like Eminem") c) preg_replace("/like/", "/hate/", "I like Eminem") d) preg_replace("hate", "like", "I like Eminem")
a) c-client library b) GIF/PNG library c) Image Library d) (your answer) GD library - correct answer
a) It requires short tags and this is not compatible with XML - correct answer b) There is no problem c) (your answer) This syntax doesn't even exist PHP library that may not always be available It requires a special
a) Ends execution of the current switch structure b) Moves on to the next iteration of the current for, foreach, while, do-while or switch structure c) (your answer) Ends execution of the current for, foreach, while, do-while or switch structure correct answer
27) Assuming all the variables a, b, c have already been defined, could this be a variable name: ${$a}[$b][$c] ?
28) Put this line php display_errors=false in a .htaccess file when you deploy the application?
a) That won't hide any error 'coz you can't use .htaccess to control the PHP engine Bad idea, I want to see when errors occur b) (your answer) That won't hide any error 'coz it's not the correct code - correct answer c) Good idea, increases security
29) What does this function do: <?php function my_func($variable) {return (is_numeric($variable) && $variable % 2 == 0);}?>
a) (your answer) $variable is a number and ends in 2 b) tests whether $variable ends in 2 c) tests whether $variable is a number and contains 2 d) tests whether $variable is an even number - correct answer
tests whether
a) response.write("Hello World") b) (your answer) document.write("Hello World") - correct answer c) ("Hello World") d) echo("Hello World")
a) (your answer) call function myFunction b) myFunction() - correct answer c) call myFunction()
4) How do you write a conditional statement for executing some statements only if "i" is equal to 5?
a) if i==5 then b) if i=5 then c) (your answer) if (i==5) - correct answer d) if i=5
5) How do you write a conditional statement for executing some statements only if "i" is NOT equal to 5?
a) Two. The "for" loop and the "while" loop - correct answer b) (your answer) Four. The "for" loop, the "while" loop, the "do...while" loop, and the "loop...until" loop c) One. The "for" loop
a) for (i = 0; i <= 5)
b) (your answer) for (i = 0; i <= 5; i++) - correct answer c) for i = 1 to 5 d) for (i <= 5; i++)
a) var txt = new Array(1:"tim",2:"shaq",3:"kobe") b) var txt = new Array="tim","shaq","kobe" c) (your answer) var txt = new Array("tim","shaq","kobe") - correct answer
9) How do you round the number 8.25, to the nearest whole number?
11) What is the correct JavaScript syntax for opening a new window called "window5" ?
a) window.status = "put your message here" - correct answer b) statusbar = "put your message here" c) status("put your message here") d) (your answer) window.status("put your message here")
a) (your answer) var myarray = new Array(); - correct answer b) var myarray = array new; c) var new Array() = myarray; d) var new array = myarray;
a) onmouseover and onmousedown b) onmousedown and onmouseout c) (your answer) onmousedown and onmouseup - correct answer d) onmouseup and onmouseout
17) Which property would you use to redirect visitor to another page?
1)<?php $x=array("aaa","ttt","www","ttt","yyy","tttt"); $y=array_count_values($x); echo $y[ttt]; ?> a)2 b)3 c)1 d)4 Show Answer
2) How do you get information from a form that is submitted using the "get" method?
3)What's the best way to copy a file from within a piece of PHP? a) Print out a message asking your user to "telnet" in to the server and copy the file for you b) Open the input and output files, and use read() and write() to copy the data block by block until read() returns a zero c) Use the built in copy() function d) Use "exec" to run an operating system command such as cp (Unix, Linux) or copy (Windows) Show Answer
4) PHP code is embedded directly into XHTML document? a) False b) True Show Answer
5) Is it possible to submit a form with out a submit button? a) Yes b) No Show Answer
7) What is the expansion of LAMP? a) Linux And Mysql Php b) Linux Apache Mysql Php Show Answer
8) In php Which method is used to getting browser properties? a) $_SERVER['HTTP_USER_AGENT']; b) $_SERVER['PHP_SELF'] c) $_SERVER['SERVER_NAME'] d) $_SERVER['HTTP_VARIENT'] Show Answer
9) Which of the following function is used to pick one or more random values from PHP Array? a) array_rand() b) array_random() c) Random_array() d) Rand_array() Show Answer
11) Assume that your php file 'index.php' in location c:/apache/htdocs/phptutor/index.php. If you used $_SERVER['PHP_SELF'] function in your page, then what is the return value of this function ? a) phptutor/index.php b) /phptutor/index.php c) c:/apache/htdocs/phptutor/index.php d) index.php Show Answer
12) Which operator is used to concatenate two strings in php? a) dot operator (.) b) plus operator (+) Show Answer
a) Yes - regular expressions use Perl-like conventions b) Yes - PHP supports two different types of regular expressions: POSIX-extended and PerlCompatible Regular Expressions (PCRE). c) Yes - regular expressions use the POSIX standard d) No - PHP uses "glob" style matching only Show Answer
14) In PHP, which of the following function is used to insert content of one php file into another php file before server executes it a) include[] b) #include() c) include() d) #include{} Show Answer
15) what will be the ouput of below code ? Assume that today is 2009-5-19:2:45:32 pm <?php $today = date("F j, Y, g:i a"); ?> a) may 19,09,2:45:32 PM b) May 19, 2009, 2:45 pm c) May 19,2009,14:45:32 pm d) May 19,2009,14:45:32 PM Show Answer
16) Which of the following function is used for terminate the script execution in PHP? a) break()
17) What function used to print statement in PHP? a) echo(); b) printf c) "" Show Answer
19) what will be the output of below code ? <?php $arr = array(5 => 1, 12 => 2); $arr[] = 56; $arr["x"] = 42; unset($arr); echo var_dump($arr); ?>
20) PHP variables are a) Multitype variables b) Double type variables c) Single type variable d) Trible type variables Show Answer
21) Which of these statements is true? a) PHP interfaces to the MySQL database,and you should transfer any data in Oracle or Sybase to MySQL if you want to use PHP on the data. b) PHP interfaces to a number of relational databases such as MySQL, Oracle and Sybase. A wrapper layer is provided so that code written for one database can easily be transferred to another if you later switch your database engine. c) PHP interfaces to a number of relational databases such as MySQL, Oracle and Sybase but the interface differs in each case. d) There's little code in PHP to help you interface to databases, but there's no reason why you can't write such code if you want to. Show Answer
23) How would you add 1 to the variable $count? a) incr count; b) $count++; c) $count =+1 d) incr $count; Show Answer
24) Which of the following is used to check if a function has already been defined? a) bool function_exists(functionname) b) bool f_exists(functionname) c) bool func_exist(functioname) Show Answer
25) what is the return value of this substr function? <?php $rest = substr("abcdef", -1); $rest = substr("abcdef", 0, -1); ?> a) f,abcde b) a,fedcb c) b,abcdef d) a,abcde Show Answer
26) Assume that your php file 'index.php' in location c:/apache/htdocs/phptutor/index.php. If you used basename($_SERVER['PHP_SELF']) function in your page, then what is the return value of this function ? a) phptutor b) phptutor/index.php c) index.php d) /index.php Show Answer
27) $x="display"; ${$x.'_result'} (); ?> Above program will call the function display_result() a) False b) True c) Parser Error d) None of the above Show Answer
28) All variables in PHP start with which symbol? a) ! b) $ c) & d) % Show Answer
29) Father of PHP? a) Larry Wall b) Rasmus Lerdorf c) James Gosling d) Guido Van Rossum Show Answer
30) In PHP the error control operator is _______ a) . b) * c) @ d) & Show Answer
31) $str="3dollars"; $a=20; $a+=$str; print($a); ?> Output ? a) 23dollars b) 203dollars c) 320dollars d) 23 Show Answer
32) <?php
function zz(& $x) { $x=$x+5; } ?> $x=10; zz($x); echo $x; a) 5 b) 0 c) 15 d) 10 Show Answer
33) <?php echo $_SERVER['REMOTE_ADDR']; ?> a) shows the IP address of the local system b) shows the IP address of the visitor c) shows the IP address of the webserver d) None of the above Show Answer
What is the following output? a) display all folder names b) display a folder content c) display content of the all drives d) Parse error Show Answer
35) <?php $qpt = 'QualityPointTechnologies'; echo preg_match("/^Quality/", $qpt); ?> a) 1 b) 0 c) Quality d) Null Show Answer
36) <?php $test="3.5seconds"; settype($test,"double"); settype($test,"integer"); settype($test,"string"); print($test); ?> What is the following output? a) 3.5 b) 3.5seconds c) 3 d) 3seconds
Show Answer
37) <?php $x=array(2=>"mouse",7=>"keyboard"); $y=array_keys($x); echo $y[1]; ?> a) keyboard b) mouse c) 7 d) 2 Show Answer
38) $data="98.8degrees"; (double)$data; (int)$data; (string)$string; echo $data; ?> a) 98 b) 98.8 c) 98.8degrees d) degrees Show Answer
Show Answer
40) <?php $x="101.5degrees"; (double)$x; (int)$x; echo (string)$x; ?> a) 101.5 b) degrees c) 101 d) 101.5degrees Show Answer
41) Whether One-line comment begin with pound sing(#) in php? a) True b) False c) None of above Show Answer
42) In PHP, during error handling include() generates...................... a) a fatal error, and the script will stop b) a warning, but the script will continue execution c) None of the above Show Answer
43) <?php
$qpt = 'Eat to live, but not live to eat'; echo preg_match("/^to/", $qpt); ?> a) 0 b) 1 c) to d) Null Show Answer
44) <?php $x=array("aaa","","ccc","ddd",""); $y=array_unique($x); echo count($x) . "," . count($y); ?> a) 3,1 b) 3,3 c) 5,5 d) 5,4 Show Answer
45) PHP is a _____ . It means you do not have to tell PHP which data type the variable is.PHP automatically converts the variable to the correct data type, depending on its value. a) client side language b) local language c) global language d) loosely typed language Show Answer
46) Which of the following is not a valid variable name? a) $number-in-class b) $nic c) $NumberInClass d) $number_in_class Show Answer
47) Which of the following function is used to change the root directory in PHP? a) choot() b) change_root() c) cd_root() d) cd_r() Show Answer
48) PHP is a) client side script language b) server side script language c) event-driven language Show Answer
51) The PHP syntax is most similar to: a) PERL and C b) Java script c) VB Script d) Visual Basic Show Answer
52) what will be the output of below code ? <?php $arr = array(5 => 1, 12 => 2); $arr[] = 56; $arr["x"] = 42; echo var_dump($arr); ?>
a) 42 b) array(3) { [12]=> int(2) [13]=> int(56) ["x"]=> int(42) } c) array(4) { [5]=>int(1) [12]=> int(2) [13]=> int(56) ["x"]=> int(42) } d) 1,2,56,42 Show Answer
53) what will the ouptut of below date() function ? <?php $date="2009-5-19"; $time="14:31:38"; $datetime=$date.$time; echo date("Y-m-d:H:i:s",strtotime($datetime)); ?> a) 2009-5-19:14:31:38 b) 2009-5-19:2:31:38 c) 19-5-2009:2:31:38 d) 19/5/2009:14:31:38 Show Answer
54) <?php $color=array("red","yellow","white"); $x=in_array("black",$color); if($x==0) echo "good bye"; if($x==1) echo "Hello"; ?> a)Hello b) Error c) good bye d) None of the above
Show Answer
Answers (1) a (11) b (21) c (31) d (41) a (51) a (2) a (12) a (22) a (32) c (42) b (52) c (3) c (13) b (23) b (33) b (43) a (53) a (4) b (14) c (24) a (34) b (44) d (54) c (5) a (15) b (25) a (35) a (45) d (6) b (16) c (26) c (36) c (46) a (7) b (17) a (27) b (37) c (47) a (8) a (18) d (28) b (38) c (48) b (9) a (19) c (29) b (39) b (49) a (10) b (20) a (30) c (40) d (50) b