1 | D | PHP previously stood for Personal Home Page now stands for Hypertext Preprocessor.
|
2 | C | |
3 | C | Every section of PHP code starts and ends by turning on and off PHP tags to let the server know that it needs to execute the PHP in between them.
|
4 | B | Any of the above editors can be used to type php code and run it.
|
5 | D | To run PHP code you need to have PHP and a web server, both IIS and Apache are web servers.You can choose either one according to your platform.
|
6 | D | A variable can’t start with a number. Also $this is a special variable that can’t be assigned, but $This can be assigned
|
7 | C | The $bar = &$foo; line will reference $foo via $bar.
|
8 | B | echo(), print() and printf() all three can be used to output a statement onto the screen. The sprintf() statement is functionally identical to printf() except that the output is assigned to a string rather than rendered to the browser.
|
9 | A | ($i > ++$i) evaluates to 0 but -1 makes it enters the loop and prints i which is 0. |
10 | C | Use of undefined constant red. |
11 | C | + does not return 1 if the variables are equal. |
12 | A | Anything starting from 0 is evaluated as an octal. |
13 | C | The array_merge() function merges one or more arrays into one array. |
14 | B | |
15 | D | The array_fill() function fills an array with values. |
16 | B | While condition always gives 1. |
17 | A | The array_diff() function compares the values of two (or more) arrays, and returns the differences. |
18 | C | ${VAR_NAME} creates a new variable which is not same as VAR_NAME. |
19 | A | You can change this name by using the session.name directive. |
20 | C | |
21 | B | As it is && operator it is being incremented and decremented continuously. |
22 | B | The variable contains the last value which has been assigned. |
23 | D | The . operator is used to join to strings. |
24 | D | The array_shift() function removes the first element from an array, and returns the value of the removed element. |
25 | B | Within flat files(files), within volatile memory(mm), using the SQLite database(sqlite), or through user defined functions(user). |
26 | D | Keyword like IF cannot be used as constant names. |
27 | C | When the format is E the timezone is identified and returned…example America/New_York. |
28 | A | The array_count_values() function counts all the values of an array. |
29 | B | |
30 | A | The array_pop() function deletes the last element of an array. |
31 | B | /* */ is used for commenting multiple lines. |
32 | A | The t parameter is used to determine the number of days in the current month. |
33 | B | The array_combine() function creates an array by using the elements from one keys array and one values array. |
34 | C | Thestrtotime() function and GNU date syntax is used to calculating the date x days from the present date. |
35 | D | April has 30 days and the above date is 31 therefore Invalid is returned. |
36 | C | __LINE__ is a magical constant that gives the current line number and cannot be used a variable/constant name. |
37 | D | In a class constants should be defined const MIN_VALUE = 0.0; const MAX_VALUE = 1.0; instead. |
38 | C | + operator does not join both the strings. |
39 | C | The array_change_key_case() function changes all keys in an array to lowercase or uppercase. |
40 | B | While condition always gives 1. |
41 | B | Constants do not need a $ before them, they are referenced by their variable names itself. |
42 | D | It has to be $color1 = red; and $color2 = green; therefore the error. |
43 | D | The loop never ends as i is always incremented and then decremented. |
44 | B | The getlastmod() function returns the value of the pages Last Modified header or FALSE in the case of an error. |
45 | D | + just returns the numeric value even though it is inside double quotes. |
46 | A | As it is || operator the second expression is not evaluated till i becomes 1 then it goes into a loop. |
47 | B | The directive which determines this is session.cache_expire. |
48 | A | echo constant(x) output x, and x here is the concatenation of GREETING_ and $changing variable with. operator. |
49 | A | The lifetime is specified in seconds, so if the cookie should live 1 hour, this directive should be set to 3600. |
50 | B | Constants can be set as values for other constants. |
51 | C | The first condition itself fails thus the loop exits. |
52 | B | The array() function is used to create an array. Each elements are assigned ab index as the rule of an array. So, calling $cars[0] will print element at index 0 and so on. |
53 | D | Since the third parameter is true in define(GREETING, PHP is a scripting language, true) is true GREETING becomes case insensitive. |
54 | D | ThedateTime() method is class constructor. You can set the date either at the time of instantiation or later by using a variety of mutators. |
55 | A | Day of month, with leading zero is represented by D; Daylight saving time by I; Day of month, without zeros by j. |
56 | D | The directivesession.cookie_domain determines the domain for which the cookie is valid. |
57 | A | As it is || operator the second expression is not evaluated and i is always incremented, in the first case to 1. |
58 | B | Class constants cannot be defined outside class. |
59 | C | Thesession.gc_maxlifetime directive determines this duration. It can be set to any required value. |
60 | C | |
61 | D | Its prototype follows: session.save_handler = files|mm|sqlite|user. |
62 | A | i is decremented in the first while execution and then continuously incremented back. |
63 | B | + can be used to add to integer values which are enclosed by double-quotes. |
64 | D | F is the parameter for complete text representation of month, d for day of month, and Y for 4 digit representation of year. |
65 | D | The array_chunk() function splits an array into chunks of new arrays. |
66 | A | The loop ends when i becomes 0. |
67 | B | The prototype of this function is: string date(string format [, int timestamp]). |
68 | A | + gives the value 1 and . is used to give join 1 and grey. |