Technical Interview Questions

Recent Question and Answers

Ans: Database name: 64 characters Table name: 64 characters Column name: 64 characters ....! www.w3answers.com ->>> List files and directories inside the specified path ->>> By default files order will be ascending ->>> make $f = scandir($direct, 1); it will display the files as descending order ....! * Anything from a form* Anything from $_GET, $_POST, $_REQUEST* Cookies ($_COOKIES)* Web services data* Files* Some server variables (e.g. $_SERVER['SERVER_NAME'])* Environment variables* Database query results Filter supports get, post, cookies, server and environment variables as well as defined variables (server support may not work in all sapi, for filter 0.11.0 or php 5.2.0). ....!
....! The answer is 0 (Zero) Important note Everyone expected answer would be 4.But answer is zero.How it happened only in php ? The ^ operator is different in each language.In PHP ^ means the bitwise exlusive or of the two numbers. www.w3answers.com ....! There are a few things you should be aware of: 1. Since cookies are used to record information about your activities on a particular domain, they can only be read by the domain that created them 2. A single domain cannot set more than twenty cookies, and each cookie is limited to a maximum size of 4 KB 3. A cookie usually possesses six attributes, of which only the first is mandatory. Here they are: * name: the name of the cookie * value: the value of the cookie
$s=”hihihi”; echo $s. “ welcome”.$s; a) syntax error b) runtime error c) all of the above d) hihihi welcome hihihi ANS: d ....! <?php echo 'Hello World'; ?> ....! Ans: MySQL SET function can take zero or more values, but at the maximum it can take 64 values. ....! Persistent database connections work only in the module installation of PHP. If you ask for a persistent connection in the CGI version, you will simply get a regular connection. if you become convinced that the sheer overhead of opening new database connections is killing your performance, you might want to investigate opening persistent connections.Unlike regular database connections, these connections are not automatically killed when your page exits (or even when mysql_close() is called) but are saved ....! <?php $p = getcwd(); echo $p; ?> Ans: getcwd() Here I have stored my files under httdocs (using php5,i haven't checked under php4) so I get the output as C:\apache2triad\htdocs you may get your path information while runnings the above code. :)   We can use a simple JavaScript code linked to an event trigger of any form field. In the JavaScript code, we can call the document.form.submit() function to submit the form ....! 1)Call to undefined function we_w3answers() ***************************************** PHP is trying to call the function we_w3answers(), which has not been because you misspelled the name of a function (built-in or user-defined) simply omitted the function definition. If you use include/require functions, make sure that you are loading the appropriate files. 2)Call to undefined function array() *********************************** This problem has a cause that i....! Constructors - PHP4 Constructors are functions in a class that are automatically called when you create a new instance of a class with new. A function becomes a constructor, when it has the same name as the class. If a class has no constructor, the constructor of the base class is being called, if it exists. <?php class Auto_Cart extends Cart { function Auto_Cart() { $this->add_item("10", 1); } } ?> This defines a class Auto_Cart that is a Cart plus....! <?php $x = 3; switch ($x) { case 2: echo 'line 1'; break; case 3: case 4: echo 'line 2'; break; default: echo 'line 3'; } ?> a. echo 'line 3'; b. echo 'line 2'; c. Error d. None of the above Ans: b (Answer is line2) www.w3answers.com ....!

<?php
$x = 3;
switch ($x) {
case 2: echo 'line 1'; break;
case 3:
case 4: echo 'line 2'; break;
default: echo 'line 3';
}
?>

a. echo 'line 3';
b. echo 'line 2';
c. Error
d. None of the above

Ans: b (Answer is line2)

www.w3answers.com

....!