Vous êtes sur la page 1sur 39

1. What is the default execution time set in set_time_limit()? You answered: 20 secs Incorrect Correct answer: 30 secs 2.

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?

Correct By using func_num_args()


7. How can we count the number of elements in an array? Correct using sizeof() and count()

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

the last column will take precedence


17. What is the use of mysql_pconnect()? You answered: Used to create a persistant connection to mysql server. Incorrect Correct answer: Both b and c above

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

< input name="MyArray[]" />


30. Can I generate DLL files from PHP scripts like i can in Perl ? You answered: Yes Incorrect Correct answer: No 31. How can I run COM object from remote server ?

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

Built-in native support for SQLite improved MySQL support


33. Which of the following differences are valid between PHP 4 and PHP 5? Correct 34. Which of the following rules below is/are false for exceptions? You answered: Both a and b above Incorrect Correct answer: Exceptions cannot be thrown (or re-thrown) in a catch block within a try block 35. What is x+ mode in fopen() used for?

Correct - Read/Write. Creates a new file. Returns FALSE and an error if file already exists
36. What is the strpos() function used for?

Correct - Search for character within a string


37. Is strstr and strchr aliases? You answered: No Incorrect Correct answer: Yes 38. Which function is used to Strip whitespace (or other characters) from the beginning and end of a string? Correct

39. echo does not return any value Correct

MYSQL
1. What is a candidate key? Correct

Used to uniquely identify a row


2. Can I call a trigger directly called from an application? You answered: Yes Incorrect Correct answer: No 3. A view is nothing but a ________ table or a stored query Correct - Virtual 4. How can we get the number of records or rows in a table? 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

SELECT CURTIME(); SELECT CURDATE(); SELECT CURRENT_TIME();

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

Data is present in the other table


18. BLOB data type can have default column value. Correct 19. How much storage space does DATETIME require? You answered: 2 bytes Incorrect Correct answer: 8 bytes 20. If an ENUM column is declared NOT NULL, its default value is the first element of the list of allowed values. You answered: False, ENUM column cannot be null Incorrect Correct answer: True

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

Client-side image maps


13. Which of the following is the correct way for writing Java Script array? Correct 14. What is the purpose of <noscript> tag in Java Script? Correct 15. Java Script entities start with ____________ and end with ______________ Correct - &,; 16. Which of the following is a server-side Java Script object? You answered: FileUpload Incorrect Correct answer: File 17. Which of the following is a client-side Java Script object? You answered: Time

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

1) In PHP, arrays may be sorted with which of the following functions?

a) uksort() b) arsort() c) ksort() d) (your answer) All of the above - correct answer

2) PHP comments for a single line have the following syntax:

a) /* comments /* b) # c) // d) :: e) (your answer) A&B - correct answer

3) Which of the following functions are used by PHP to find out what type a variable is?

a) gettype() b) is_double() c) (your answer) get_type() d) is_date() e) A&B - correct answer

4) The three possible connection states in PHP are ________.

a) normal b) aborted c) timeout d) (your answer) All of the above - correct answer

5) In PHP, the error control operator is ________.

a) (your answer) * b) % c) @ - correct answer d) &

6) In PHP, instructions are terminated with a _______.

a) (your answer) ; - correct answer b) # c) ! d) %>

7) What does PHP stand for?

a) (your answer) PHP: Hypertext Preprocessor - correct answer b) Personal Home Page c) Private Home Page d) Personal Hypertext Processor

8) PHP server scripts are surrounded by delimiters, which?

a) <?php>...</?> b) (your answer) <?php?> - correct answer c) <script>...</script> d) <&>...</&>

9) How do you write "Hello World" in PHP

a) "Hello World"; b) (your answer) echo "Hello World"; - correct answer c) Document.Write("Hello World"); d) response.write("Hello World")

10) All variables in PHP start with which symbol?

a) ! b) (your answer) $ - correct answer c) & d) #

11) Include files must have the file extension ".inc"

a) True b) (your answer) False - correct answer

12) In PHP you can use both single quotes ( ' ' ) and double quotes ( " " ) for strings:

a) (your answer) True - correct answer b) False

13) What is the correct way to include the file "time.inc" ?

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" %>

14) What is the correct way to create a function in PHP?

a) (your answer) function myFunction() - correct answer b) new_function myFunction() c) create myFunction()

15) What is the correct way to connect to a MySQL database?

a) mysql_open("localhost"); b) connect_mysql("localhost"); c) dbopen("localhost"); d) (your answer) mysql_connect("localhost"); - correct answer

16) What is the correct way to add 1 to the $count variable?

a) count++; b) (your answer) $count++; - correct answer c) ++count d) $count =+1

17) PHP can be run on Microsoft Windows IIS(Internet Information Server):

a) (your answer) True - correct answer b) False

18) In PHP 5, MySQL support is enabled by default:

a) (your answer) True b) False - correct answer

19) Which one of these variables has an illegal name?

a) (your answer) $my-Var - correct answer b) $myVar c) $my_Var

20) Which of the following regular expressions will match the string no.no.no?

a) no?no?no b) no*no*no* c) ..\...\... - correct answer d) (your answer) \.\..\.\..\.\.

21) A constructor is a special kind of

a) Class b) (your answer) Method - correct answer c) Object d) Variable

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")

23) What library do you need in order to process images?

a) c-client library b) GIF/PNG library c) Image Library d) (your answer) GD library - correct answer

24) What is the problem with <?=$expression ?> ?

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

25) What does break; do?

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

26) Can this PHP code be valid: $4bears = $bears->getFirst4();

a) Yes - correct answer b) (your answer) No

27) Assuming all the variables a, b, c have already been defined, could this be a variable name: ${$a}[$b][$c] ?

a) Yes - correct answer b) (your answer) No

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

1) Inside which HTML element do we put the JavaScript?

a) <scripting> b) <javascript> c) (your answer) <script> - correct answer d) <js>

2) What is the correct JavaScript syntax to write "Hello World"?

a) response.write("Hello World") b) (your answer) document.write("Hello World") - correct answer c) ("Hello World") d) echo("Hello World")

3) How do you call a function named "myFunction"?

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) (your answer) if (i <> 5) b) if (i != 5) - correct answer c) if =! 5 then d) if <> 5

6) How many different kind of loops are there in JavaScript?

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

7) How does a "for" loop start?

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++)

8) What is the correct way to write a JavaScript array?

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?

a) Math.rnd(8.25) b) (your answer) Math.round(8.25) - correct answer c) round(8.25) d) rnd(8.25)

10) How do you find the largest number of 6 and 8?

a) (your answer) Math.max(6,8) - correct answer b) top(6,8) c) ceil(6,8) d) Math.ceil(6,8)

11) What is the correct JavaScript syntax for opening a new window called "window5" ?

a) new("http://www.ex-designz.net","window5") b) (your answer) window.open("http://www.ex-designz.net","window5") - correct answer c) open.newwindow("http://www.ex-designz.net","window5") d) new.window("http://www.ex-designz.net","window5")

12) How do you put a message in the browser's status bar?

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")

13) How do you find the client's browser name?

a) browser.name b) (your answer) navigator.appName - correct answer c) client.navName

14) You define an array using

a) (your answer) var myarray = new Array(); - correct answer b) var myarray = array new; c) var new Array() = myarray; d) var new array = myarray;

15) Onclick is equivalent to which two events in sequence

a) onmouseover and onmousedown b) onmousedown and onmouseout c) (your answer) onmousedown and onmouseup - correct answer d) onmouseup and onmouseout

16) Whicj best describe void?

a) (your answer) A method

b) A function c) An operator - correct answer d) A statement

17) Which property would you use to redirect visitor to another page?

a) (your answer) window.location.href - correct answer b) document.href c) java.redirect.url d) link.redirect.href

18) Which of the following JavaScript statements use arrays?

a) (your answer) setTimeout("a["+i+"]",1000) - correct answer b) k = a & i c) k = a(i)

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?

a)$_GET[]; b)Request.Form; c)Request.QueryString; d)$_POST[]; Show Answer

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

6) Full form of PHP

a) PreHypertextProcessor b) HypertextPreprocessor c) Hypertext Postprocessor d) PostHypertextProcessor 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

10) <?php $x=array(1,3,2,3,7,8,9,7,3); $y=array_count_values($x); echo $y[8]; ?> a) 43 b) 1 c) 8 d) 6 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

13)Are there regular expressions in PHP?

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()

b) quit() c) die() Show Answer

17) What function used to print statement in PHP? a) echo(); b) printf c) "" Show Answer

18) <?php define("x","5"); $x=x+10; echo x; ?> a) Error b) 15 c) 10 d) 5 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); ?>

a) 42 b) 56 c) Null d) x=42 Show Answer

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

22) Is php can support multiple inheritance? a) NO

b) YES 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

34) <?php $x=dir("."); while($y=$x->read()) { echo $y." " } $y->close(); ?>

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

39) PHP is a) Partially cross-platform b) Truly cross-platform c) None of above

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

49) $father="mother"; $mother="son"; echo $$father; ?> a) son b) mother

c) motherson d) error Show Answer

50) <?php $x=array(4,2,5,1,4,5,3,4); $y=array_count_values($x); echo count($y); ?> a) 8 b) 5 c) 7 d) 28 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

Easy Learning - PHP

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

Vous aimerez peut-être aussi