• +91 9971497814
  • info@interviewmaterial.com

Computer Interview Questions Answers

PHP Interview Questions Answers

Question - 61 : - How many ways we can give the output to a browser?

Answer - 61 : - HTML output PHP, ASP, JSP, Servlet Function Script Language output Function Different Type of embedded Package to output to a browser  

Question - 62 : - In how many ways we can retrieve data in the result set of MYSQL using PHP?

Answer - 62 : - mysql_fetch_array - Fetch a result row as an associative array, a numeric array, or both mysql_fetch_assoc - Fetch a result row as an associative array mysql_fetch_object - Fetch a result row as an object mysql_fetch_row —- Get a result row as an enumerated array

Question - 63 : - What are the difference between abstract class and interface?

Answer - 63 : - Abstract class: abstract classes are the class where one or more methods are abstract but not necessarily all method has to be abstract. Abstract methods are the methods, which are declare in its class but not define. The definition of those methods must be in its extending class. Interface: Interfaces are one type of class where all the methods are abstract. That means all the methods only declared but not defined. All the methods must be define by its implemented class.

Question - 64 : - When are you supposed to use endif to end the conditional statement?

Answer - 64 : - When the original if was followed by : and then the code block without braces.

Question - 65 : - How do you pass a variable by value?

Answer - 65 : - Just like in C++, put an ampersand in front of it, like $a = &$b

Question - 66 : - What is PEAR in php?

Answer - 66 : - PEAR(PHP Extension and Application Repository) is a framework and repository for reusable PHP components. PEAR is a code repository containing all kinds of php code snippets and libraries. PEAR also offers a command-line interface that can be used to automatically install "packages".

Question - 67 : - What is meant by PEAR in php?

Answer - 67 : - 1) - PEAR is the next revolution in PHP. This repository is bringing higher level programming to PHP. PEAR is a framework and distribution system for reusable PHP components. It eases installation by bringing an automated wizard, and packing the strength and experience of PHP users into a nicely organised OOP library. PEAR also provides a command-line interface that can be used to automatically install "packages" 2) - PEAR is short for "PHP Extension and Application Repository" and is pronounced just like the fruit. The purpose of PEAR is to provide: A structured library of open-sourced code for PHP users A system for code distribution and package maintenance A standard style for code written in PHP The PHP Foundation Classes (PFC), The PHP Extension Community Library (PECL), A web site, mailing lists and download mirrors to support the PHP/PEAR community PEAR is a community-driven project with the PEAR Group as the governing body. The project has been founded by Stig S. Bakken in 1999 and quite a lot of people have joined the project since then.

Question - 68 : - What are the differences between GET and POST methods in form submitting, give the case where we can use GET and we can use POST methods?

Answer - 68 : - 1) - When we submit a form, which has the GET method it displays pair of name/value used in the form at the address bar of the browser preceded by url. Post method doesn't display these values. 2) - When you want to send short or small data, not containing ASCII characters, then you can use GET” Method. But for long data sending, say more then 100 character you can use POST method. Once most important difference is when you are sending the form with GET method. You can see the output which you are sending in the address bar. Whereas if you send the form with POST” method then user can not see that information. 3) -

Question - 69 : - What is the difference between characters \023 and \x23?

Answer - 69 : - The first one is octal 23, the second is hex 23. With a heredoc syntax, do I get variable substitution inside the heredoc contents? Yes.

Question - 70 : - What are the advantages and disadvantages of CASCADE STYLE SHEETS?

Answer - 70 : - External Style Sheets Advantages Can control styles for multiple documents at once Classes can be created for use on multiple HTML element types in many documents Selector and grouping methods can be used to apply styles under complex contexts Disadvantages An extra download is required to import style information for each document The rendering of the document may be delayed until the external style sheet is loaded Becomes slightly unwieldy for small quantities of style definitions Embedded Style Sheets Advantages Classes can be created for use on multiple tag types in the document Selector and grouping methods can be used to apply styles under complex contexts No additional downloads necessary to receive style information Disadvantage This method can not control styles for multiple documents at once Inline Styles Advantages Useful for small quantities of style definitions Can override other style specification methods at the local level so only exceptions need to be listed in conjunction with other style methods Disadvantages Does not distance style information from content (a main goal of SGML/HTML) Can not control styles for multiple documents at once Author can not create or control classes of elements to control multiple element types within the document Selector grouping methods can not be used to create complex element addressing scenarios

Computer Contributors

Rajeev Katiyar
Yes Baroda

Share your email for latest updates


Our partners