Important: Use custom search function to get better results from our thousands of pages

Use " " for compulsory search eg:"electronics seminar" , use -" " for filter something eg: "electronics seminar" -"/tag/" (used for exclude results from tag pages)


 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
php interview question
Post: #1

php interview question



.docx  php Interview question.docx (Size: 97.41 KB / Downloads: 41)

Questions : 1 Who is the father of PHP ?
Answers : 1 Rasmus Lerdorf is known as the father of PHP.

Questions : 2 What is the difference between $name and $$name?
Answers : 2 $name is variable where as $$name is reference variable
like $name=sonia and $$name=singh so $sonia value is singh.

Questions : 3 How can we submit a form without a submit button?
Answer : 3 Java script submit() function is used for submit form without submit button
on click call document.formname.submit()

Questions : 4 In how many ways we can retrieve the data in the result set of
MySQL using PHP?
Answer : 4 We can do it by 4 Ways
1. mysql_fetch_row. , 2. mysql_fetch_array , 3. mysql_fetch_object
4. mysql_fetch_assoc

Questions : 5 What is the difference between mysql_fetch_object and
mysql_fetch_array?
Answers : 5 mysql_fetch_object() is similar tomysql_fetch_array(), with one difference -
an object is returned, instead of an array. Indirectly, that means that
you can only access the data by the field names, and not by their
offsets (numbers are illegal property names).

Questions : 6 What are the differences between Get and post methods.
Answers : 6 There are some defference between GET and POST method
1. GET Method have some limit like only 2Kb data able to send for request
But in POST method unlimited data can we send
2. when we use GET method requested data show in url but
Not in POST method so POST method is good for send sensetive request

Questions : 7 How can we extract string "pcds.co.in " from a string
using regular expression of PHP?

Answers : 7 preg_match("/^http:\/\/[email protected](.+)$/","http://info[at]pcds.co.in",$matches);
echo $matches[1];

Questions : 8 How can we create a database using PHP and MySQL?
Answers : 8 We can create MySQL database with the use of
mysql_create_db("Database Name")

Questions : 9 What are the differences between require and include?
Answers : 9 Both include and require used to include a file but when included file not found
Include send Warning where as Require send Fatal Error .

Questions : 10 Can we use include ("xyz.PHP") two times in a PHP page "index.PHP"?
Answers : 10 Yes we can use include("xyz.php") more than one time in any page. but it create a prob when xyz.php file contain some funtions declaration then error will come for already declared function in this file else not a prob like if you want to show same content two time in page then must incude it two time not a prob

Questions : 11 What are the different tables(Engine) present in MySQL, which one is default?
Answers : 11 Following tables (Storage Engine) we can create
1. MyISAM(The default storage engine IN MYSQL Each MyISAM table is stored on disk in three files. The files have names that begin with the table name and have an extension to indicate the file type. An .frm file stores the table format. The data file has an .MYD (MYData) extension. The index file has an .MYI (MYIndex) extension. )
2. InnoDB(InnoDB is a transaction-safe (ACID compliant) storage engine for MySQL that has commit, rollback, and crash-recovery capabilities to protect user data.)
3. Merge
4. Heap (MEMORY)(The MEMORY storage engine creates tables with contents that are stored in memory. Formerly, these were known as HEAP tables. MEMORY is the preferred term, although HEAP remains supported for backward compatibility. )
5. BDB (BerkeleyDB)(Sleepycat Software has provided MySQL with the Berkeley DB transactional storage engine. This storage engine typically is called BDB for short. BDB tables may have a greater chance of surviving crashes and are also capable of COMMIT and ROLLBACK operations on transactions)
6. EXAMPLE
7. FEDERATED (It is a storage engine that accesses data in tables of remote databases rather than in local tables. )
8. ARCHIVE (The ARCHIVE storage engine is used for storing large amounts of data without indexes in a very small footprint. )
9. CSV (The CSV storage engine stores data in text files using comma-separated values format.)
10. BLACKHOLE (The BLACKHOLE storage engine acts as a "black hole" that accepts data but throws it away and does not store it. Retrievals always return an empty result)

Questions : 12 What is use of header() function in php ?
Answers : 12 The header() function sends a raw HTTP header to a client.We can use herder()
function for redirection of pages. It is important to notice that header() must
be called before any actual output is seen..

Questions : 13 How can I execute a PHP script using command line?
Answers : 13 Just run the PHP CLI (Command Line Interface) program and
provide the PHP script file name as the command line argument.

Questions : 14 Suppose your Zend engine supports the mode <? ?> Then how can u
configure your PHP Zend engine to support <?PHP ?> mode ?
Answers : 14 In php.ini file:
set
short_open_tag=on
to make PHP support

Questions : 15 Shopping cart online validation i.e. how can we configure Paypal,
etc.?

Answers : 15 Nothing more we have to do only redirect to the payPal url after
submit all information needed by paypal like amount,adresss etc.

Questions : 16 What is meant by nl2br()?
Answers : 16 Inserts HTML line breaks (<BR />) before all newlines in a string.

Questions : 17 What is htaccess? Why do we use this and Where?
Answers : 17 .htaccess files are configuration files of Apache Server which provide
a way to make configuration changes on a per-directory basis. A file,
containing one or more configuration directives, is placed in a particular
document directory, and the directives apply to that directory, and all
subdirectories thereof.
Post: #2
chances are that questions are asked:

1. What is PHP?
Ans: PHP is a server-side scripting language commonly used for web applications. PHP has many frames and cms to create websites. Even a non-technical person can cretae sites using their CMS.WordPress, osCommerce are the famus CMS of php.It is also an object-oriented programming language like java, C-sharp etc.It is very eazy to learn
2. What is the use of "echo" in php?
Ans:It is used to print a data in the web page, Example: <? Php echo 'Car Insurance'; ?>, The following code prints the text on the webpage
3. How to include a file in a php page?
Ans:We can include a file using the "include ()" or "require ()" function with the file path as its parameter.
4. What is the difference between include and require?
Ans:If the file is not found by require (), it will cause a fatal error and stop the execution of the script. If the file is not found by include (), a warning will be issued, but execution will continue.
5. require_once (), require (), include () What is the difference between them?
Ans:Require () includes and evaluates a specific file, whereas require_once () does so only if it has not been previously included (on the same page). Therefore, require_once () is recommended to use when you want to include a file in which it has many functions, for example. This way, make sure you do not include the file more times and you will not get the "function re-declared" error.
6. Differences between GET and POST methods?
Ans:We can send 1024 bytes using the GET method, but the POST method can transfer large amount of data and POST is the safe method than the GET method.
7. How to declare an array in php?
Ans:For example: var $ arr = array ('apple', 'grape', 'lemon');
8. What is the use of 'print' in php?
Ans:This is not really a real function, it is a construct of language. So you can use without parentheses with your list of arguments.
Example of printing ('PHP Interview questions');
Print 'Job Interview');
9. What is the use of the in_array () function in php?
Ans:In_array is used to check if a value exists in an array
10. What is the use of the count () function in php?
Ans:Count () is used to count all elements of an array, or something in an object
11. What is the difference between include and require?
Ans:It's how they handle faults. If the file is not found by require (), it will cause a fatal error and stop the execution of the script. If the file is not found by include (), a warning will be issued, but execution will continue.
12. What is the difference between Session and Cookie?
Ans:The main difference between sessions and cookies is that sessions are stored on the server and cookies are stored on the user's computers in the text file format. Cookies can not keep several variables while the session can contain several variables. We can establish the expiration of a cookie. The session remains active only while the browser is open. Users do not have access to the data stored in Session, since it is stored on the server. The session is primarily used for the purpose of login / logout while cookies are used for tracking user activity
13. How to set cookies in PHP?
Ans:Setcookie ("sample", "ram", time () + 3600);
14. How to retrieve a cookie value?
Ans:For example: echo $ _COOKIE ["user"];
15. How to create a session? How to establish a value in the session? How to delete data from a session?
Ans:Create session: session_start ();
Set value in session: $ _SESSION ['USER_ID'] = 1;
Delete data from a session: unset ($ _ SESSION ['USER_ID'];
16. What types of loops are there in php?
Ans:For, while, does while and foreach (NB: You must learn its use)
17. How to create a mysql connection?
Ans:Mysql_connect (server_name, username, password);
 

Marked Categories : php freshers interview questions and answers file type docx, php interview question answer, php interview question, php seminar question, php interview question and answers ppt, what are the php seminor topics, seminar topics on php, seminar topic on interview, seminar topics for interview, question of php, php toics for seminar,

[-]
Quick Reply
Message
Type your reply to this message here.

Image Verification
Image Verification
(case insensitive)
Please enter the text within the image on the left in to the text box below. This process is used to prevent automated posts.

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  i forgot answer to my secret question to access my tsc payslip Guest 1 214 08-01-2018 01:05 PM
Last Post: dhanabhagya
  free download question papers with solutions from sia group website Guest 1 0 06-01-2018 02:03 PM
Last Post: dhanabhagya
  ap pgecet 2010 question paper with key Guest 1 253 18-11-2017 10:23 AM
Last Post: jaseela123
  tata steel jet sample question paper Guest 1 635 18-11-2017 09:35 AM
Last Post: jaseela123
  cdot apprentice trainee interview question and answer for electronics Guest 1 367 17-11-2017 01:42 PM
Last Post: jaseela123
Wink ssn college be joining entrance question paper 2014 Guest 1 263 17-11-2017 01:26 PM
Last Post: jaseela123
  ssn aptitude test syllabus question papers Guest 1 0 17-11-2017 12:52 PM
Last Post: jaseela123
  marriage beuro projects php free download Guest 1 0 17-11-2017 11:59 AM
Last Post: jaseela123
  an interview with a share broker project in wikipedia Guest 1 0 15-11-2017 11:10 AM
Last Post: jaseela123
  an interview with share broker question 12th project Guest 1 0 15-11-2017 11:10 AM
Last Post: jaseela123
This Page May Contain What is php interview question And Latest Information/News About php interview question ,If Not ...Use Search to get more info about php interview question Or Ask Here

Options: