InterviewSolution
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
How To Turn On The Session Support? |
|
Answer» The session SUPPORT can be turned on automatically at the SITE level, or manually in each PHP PAGE script:
The session support can be turned on automatically at the site level, or manually in each PHP page script: |
|
| 2. |
What Is The Difference Between Reply-to And Return-path In The Headers Of A Mail Function? |
|
Answer» REPLY-to: Reply-to is where to DELIVERY the reply of the MAIL. RETURN-path: Return path is when there is a mail delivery failure occurs then where to delivery the failure notification. Reply-to: Reply-to is where to delivery the reply of the mail. Return-path: Return path is when there is a mail delivery failure occurs then where to delivery the failure notification. |
|
| 3. |
Please Give A Regular Expression (preferably Perl/preg Style), Which Can Be Used To Identify The Url From Within A Html Link Tag. |
|
Answer» Try this: /href=”([^"]*)”/i |
|
| 4. |
When You Want To Show Some Part Of A Text Displayed On An Html Page In Red Font Color? What Different Possibilities Are There To Do This? What Are The Advantages /disadvantages Of These Methods? |
|
Answer» There are 2 ways to show some part of a TEXT in red: There are 2 ways to show some part of a text in red: |
|
| 6. |
How To Reset/destroy A Cookie? |
|
Answer» Reset a cookie by specifying expire TIME in the PAST: Reset a cookie by specifying expire time in the past: |
|
| 7. |
How Can I Retrieve Values From One Database Server And Store Them In Other Database Server Using Php? |
|
Answer» For this PURPOSE, you can FIRST read the data from one SERVER into session variables. Then connect to other server and simply insert the data into the database. For this purpose, you can first read the data from one server into session variables. Then connect to other server and simply insert the data into the database. |
|
| 8. |
If We Login More Than One Browser Windows At The Same Time With Same User And After That We Close One Window, Then Is The Session Is Exist To Other Windows Or Not? And If Yes Then Why? If No Then Why? |
|
Answer» Session depends on BROWSER. If browser is closed then session is lost. The session DATA will be DELETED after session time out. If connection is lost and you RECREATE connection, then session will continue in the browser. Session depends on browser. If browser is closed then session is lost. The session data will be deleted after session time out. If connection is lost and you recreate connection, then session will continue in the browser. |
|
| 9. |
What Are The Other Commands To Know The Structure Of A Table Using Mysql Commands Except Explain Command? |
|
Answer» DESCRIBE table_name; DESCRIBE table_name; |
|
| 10. |
What Is The Maximum Length Of A Table Name, A Database Name, Or A Field Name In Mysql? |
|
Answer» DATABASE NAME: 64 CHARACTERS Database name: 64 characters |
|
| 11. |
So If Md5() Generates The Most Secure Hash, Why Would You Ever Use The Less Secure Crc32() And Sha1()? |
|
Answer» CRYPTO usage in PHP is SIMPLE, but that doesn’t mean it’s free. First off, depending on the data that you’re ENCRYPTING, you might have reasons to store a 32-bit value in the database INSTEAD of the 160-bit value to save on space. Second, the more secure the crypto is, the longer is the computation time to DELIVER the hash value. A high volume site might be significantly slowed down, if frequent md5() generation is required. Crypto usage in PHP is simple, but that doesn’t mean it’s free. First off, depending on the data that you’re encrypting, you might have reasons to store a 32-bit value in the database instead of the 160-bit value to save on space. Second, the more secure the crypto is, the longer is the computation time to deliver the hash value. A high volume site might be significantly slowed down, if frequent md5() generation is required. |
|
| 12. |
How Can We Extract String "wisdomjobs.com" From A String "mailto:info@wisdomjobs.com?subject=feedback" Using Regular Expression Of Php? |
|
Answer» ANSWER : $text = “MAILTO:info@wisdomjobs.com.com?subject=Feedback”; preg_match(’|.*@([^?]*)|’, $text, $output); echo $output[1]; Note that the SECOND index of $output, $output[1], GIVES the match, not the first one, $output[0]. Note that the second index of $output, $output[1], gives the match, not the first one, $output[0]. |
|
| 13. |
What's The Output Of The Ucwords Function In This Example? |
|
Answer» $formatted = ucwords(”FYICENTER IS COLLECTION OF INTERVIEW QUESTIONS”); What will be printed is FYICENTER IS COLLECTION OF INTERVIEW QUESTIONS. ucwords() makes every FIRST letter of every word CAPITAL, but it does not lower-case anything else. To avoid this, and get a PROPERLY formatted string, it’s worth USING strtolower() first. $formatted = ucwords(”FYICENTER IS COLLECTION OF INTERVIEW QUESTIONS”); What will be printed is FYICENTER IS COLLECTION OF INTERVIEW QUESTIONS. ucwords() makes every first letter of every word capital, but it does not lower-case anything else. To avoid this, and get a properly formatted string, it’s worth using strtolower() first. |
|
| 14. |
What Is The Difference Between Characters 23 And \x23? |
|
Answer» The FIRST ONE is OCTAL 23, the SECOND is HEX 23. The first one is octal 23, the second is hex 23. |
|
| 15. |
Why Doesn't The Following Code Print The Newline Properly? <?php $str = 'hello, There.\nhow Are You?\nthanks For Visiting Fyicenter'; Print $str; ?> |
|
Answer» Because inside the single quotes the \n character is not INTERPRETED as NEWLINE, just as a SEQUENCE of TWO characters – \ and n. Because inside the single quotes the \n character is not interpreted as newline, just as a sequence of two characters – \ and n. |
|
| 16. |
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» 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. 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. |
|
| 17. |
If The Variable $a Is Equal To 5 And Variable $b Is Equal To Character A, What's The Value Of $$b? |
|
Answer» 5, it’s a REFERENCE to EXISTING VARIABLE. 5, it’s a reference to existing variable. |
|
| 18. |
What Is The Purpose Of The Following Files Having Extensions: Frm, Myd, And Myi? What These Files Contain? |
|
Answer» In MySQL, the default table type is MYISAM. 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. The ‘.frm’ file stores the table definition. The data file has a ‘.MYD’ (MYData) extension. The index file has a ‘.MYI’ (MYIndex) extension, In MySQL, the default table type is MyISAM. 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. The ‘.frm’ file stores the table definition. The data file has a ‘.MYD’ (MYData) extension. The index file has a ‘.MYI’ (MYIndex) extension, |
|
| 19. |
Would I Use Print "$a Dollars" Or "{$a} Dollars" To Print Out The Amount Of Dollars In This Example? |
|
Answer» In this EXAMPLE it wouldn’t matter, SINCE the variable is all by itself, but if you were to print SOMETHING like “{$a},000,000 mln dollars”, then you definitely NEED to use the braces. In this example it wouldn’t matter, since the variable is all by itself, but if you were to print something like “{$a},000,000 mln dollars”, then you definitely need to use the braces. |
|
| 20. |
I Am Trying To Assign A Variable The Value Of 0123, But It Keeps Coming Up With A Different Number, What's The Problem? |
|
Answer» PHP INTERPRETER TREATS numbers beginning with 0 as octal. LOOK at the similar PHP interview QUESTIONS for more NUMERIC problems. PHP Interpreter treats numbers beginning with 0 as octal. Look at the similar PHP interview questions for more numeric problems. |
|
| 21. |
How You Provide Security For Php Application? |
|
Answer» There are many ways to accomplish the security tasks but the most common 7 ways are
There are many ways to accomplish the security tasks but the most common 7 ways are |
|
| 22. |
How To Get The Http Request In Php? |
|
Answer» When PHP is used on a Web server to HANDLE a HTTP request, it converts information submitted in the HTTP request as PREDEFINED variables:
When PHP is used on a Web server to handle a HTTP request, it converts information submitted in the HTTP request as predefined variables: |
|
| 23. |
How To Get Query String In Php For Http Request? |
|
Answer» ANSWER : $_GET[] and $_REQUEST[] |
|
| 24. |
Are Namespaces Are There In Javascript? |
|
Answer» A namespace is a CONTAINER and allows you to bundle up all your functionality using a unique name. In JavaScript, a namespace is REALLY just an OBJECT that you’ve attached all further methods, properties and OBJECTS. But it is not ALWAYS necessary to use namespace. A namespace is a container and allows you to bundle up all your functionality using a unique name. In JavaScript, a namespace is really just an object that you’ve attached all further methods, properties and objects. But it is not always necessary to use namespace. |
|
| 25. |
What Is 'float' Property In Css? |
|
Answer» The float PROPERTY SETS where an image or a text will APPEAR in ANOTHER ELEMENT. The float property sets where an image or a text will appear in another element. |
|
| 26. |
What Are The Advantages/disadvantages Of Mysql And Php? |
|
Answer» Both of them are OPEN SOURCE software (so free of COST), support CROSS platform. PHP is faster then ASP and JSP. Both of them are open source software (so free of cost), support cross platform. php is faster then ASP and JSP. |
|
| 27. |
What Is The Purpose Of The Following Files Having Extensions .frm .myd .myi? What Do These Files Contain? |
|
Answer» In MYSQL, the default table type is MyISAM. 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. The ‘.frm’ file stores the table DEFINITION. The data file has a ‘.MYD’ (MYData) extension. The index file has a ‘.MYI’ (MYIndex) extension, In MySql, the default table type is MyISAM. 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. The ‘.frm’ file stores the table definition. The data file has a ‘.MYD’ (MYData) extension. The index file has a ‘.MYI’ (MYIndex) extension, |
|
| 28. |
How Many Tables Will Create When We Create Table, What Are They? |
|
Answer» The ‘.frm’ file STORES the table DEFINITION. The ‘.frm’ file stores the table definition. |
|
| 29. |
What Are The Other Commands To Know The Structure Of Table Using Mysql Commands Except Explain Command? |
|
Answer» DESCRIBE Table-Name; describe Table-Name; |
|
| 30. |
List Out The Predefined Classes In Php? |
|
Answer» You can maintain two SEPARATE LANGUAGE file for each of the language. all the LABELS are put in both language files as variables and assign those variables in the PHP source. on runtime choose the REQUIRED language option. You can maintain two separate language file for each of the language. all the labels are put in both language files as variables and assign those variables in the PHP source. on runtime choose the required language option. |
|
| 31. |
List Out Some Tools Through Which We Can Draw E-r Diagrams For Mysql. |
|
Answer»
Case Studio Smart Draw |
|
| 32. |
How Can I Know That A Variable Is A Number Or Not Using A Javascript? |
|
Answer» bool is_numeric ( MIXED var) Returns TRUE if var is a number or a numeric string, FALSE otherwise.or use isNaN(mixed var)The isNaN() function is USED to check if a VALUE is not a number. bool is_numeric ( mixed var) Returns TRUE if var is a number or a numeric string, FALSE otherwise.or use isNaN(mixed var)The isNaN() function is used to check if a value is not a number. |
|
| 33. |
What Is The Php Predefined Variable That Tells The What Types Of Images That Php Supports? |
|
Answer» THOUGH i am not sure if this is wrong or not, With the exif extension you are ABLE to WORK with IMAGE META data. Though i am not sure if this is wrong or not, With the exif extension you are able to work with image meta data. |
|
| 34. |
How Can We Know The Count/number Of Elements Of An Array? |
|
Answer» 2 ways
2 ways
|
|
| 35. |
How Many Ways We Can Pass The Variable Through The Navigation Between The Pages? |
Answer»
|
|
| 36. |
How Can We Optimize Or Increase The Speed Of A Mysql Select Query? |
| Answer» | |
| 37. |
What Is The Maximum Size Of A File That Can Be Uploaded Using Php And How Can We Change This? |
|
Answer» By default the MAXIMUM size is 2MB. and we can change the FOLLOWING SET up a php.iniupload_max_filesize = 2M By default the maximum size is 2MB. and we can change the following set up a php.iniupload_max_filesize = 2M |
|
| 38. |
How Can We Get The Browser Properties Using Php? |
|
Answer» By USING $_SERVER['HTTP_USER_AGENT'] VARIABLE. By using $_SERVER['HTTP_USER_AGENT'] variable. |
|
| 39. |
How Can We Get The Properties (size, Type, Width, Height) Of An Image Using Php Image Functions? |
|
Answer» To KNOW the IMAGE type use exif_imagetype () To know the Image type use exif_imagetype () |
|
| 40. |
What Is The Use Of Friend Function? |
|
Answer» Sometimes a function is best shared AMONG a number of DIFFERENT classes. Such functions can be declared either as member functions of one class or as global functions. In either case they can be set to be friends of other classes, by USING a friend specifier in the class that is admitting them. Such functions can use all ATTRIBUTES of the class which names them as a friend, as if they were themselves members of that class. A friend declaration is essentially a prototype for a member function, but instead of requiring an implementation with the name of that class attached by the double colon syntax, a global function or member function of another class provides the match. Sometimes a function is best shared among a number of different classes. Such functions can be declared either as member functions of one class or as global functions. In either case they can be set to be friends of other classes, by using a friend specifier in the class that is admitting them. Such functions can use all attributes of the class which names them as a friend, as if they were themselves members of that class. A friend declaration is essentially a prototype for a member function, but instead of requiring an implementation with the name of that class attached by the double colon syntax, a global function or member function of another class provides the match. |
|
| 41. |
What Are The Features And Advantages Of Object-oriented Programming? |
|
Answer» One of the main advantages of programming is its ease of MODIFICATION; objects can easily be modified and added to a system there by reducing maintenance costs. programming is also CONSIDERED to be better at MODELING the real world than is procedural programming. It ALLOWS for more complicated and flexible interactions. systems are also EASIER for non-technical personnel to understand and easier for them to participate in the maintenance and enhancement of a system because it appeals to natural human cognition patterns. For some systems, an approach can speed development time since many objects are standard across systems and can be reused. Components that manage dates, shipping, shopping carts, etc. can be purchased and easily modified for a specific system One of the main advantages of programming is its ease of modification; objects can easily be modified and added to a system there by reducing maintenance costs. programming is also considered to be better at modeling the real world than is procedural programming. It allows for more complicated and flexible interactions. systems are also easier for non-technical personnel to understand and easier for them to participate in the maintenance and enhancement of a system because it appeals to natural human cognition patterns. For some systems, an approach can speed development time since many objects are standard across systems and can be reused. Components that manage dates, shipping, shopping carts, etc. can be purchased and easily modified for a specific system |
|
| 42. |
What Are The Reasons For Selecting Lamp (linux, Apache, Mysql, Php) Instead Of Combination Of Other Software Programs, Servers And Operating Systems? |
|
Answer» All of those are open source resource. SECURITY of Linux is very very more than WINDOWS. APACHE is a better SERVER that IIS both in functionality and security. MySQL is world most popular open source database. PHP is more faster that asp or any other SCRIPTING language. All of those are open source resource. Security of Linux is very very more than windows. Apache is a better server that IIS both in functionality and security. MySQL is world most popular open source database. PHP is more faster that asp or any other scripting language. |
|
| 43. |
Suppose Your Zend Engine Supports The Mode <? ?> Then How Can U Configure Your Php Zend Engine To Support <?php ?> Mode ? |
|
Answer» In PHP.ini FILE: SET short_open_tag=on to MAKE PHP SUPPORT In php.ini file: set short_open_tag=on to make PHP support |
|
| 44. |
Functions In Imap, Pop3 And Ldap? |
|
Answer» You can FIND these SPECIFIC INFORMATION in PHP MANUAL. You can find these specific information in PHP Manual. |
|
| 45. |
What Are The Different Tables Present In Mysql, Which Type Of Table Is Generated When We Are Creating A Table In The Following Syntax: Create Table Employee (eno Int(2),ename Varchar(10)) ? |
|
Answer» Total 5 types of tables we can create
MyISAM is the DEFAULT storage ENGINE as of MYSQL 3.23 and as a result if we do not specify the table name EXPLICITLY it will be assigned to the default engine. Total 5 types of tables we can create MyISAM is the default storage engine as of MySQL 3.23 and as a result if we do not specify the table name explicitly it will be assigned to the default engine. |
|
| 46. |
In How Many Ways We Can Retrieve The Data In The Result Set Of Mysql Using Php? |
Answer»
You can do it by 4 Ways |
|
| 47. |
Who Is The Father Of Php And Explain The Changes In Php Versions? |
|
Answer» Rasmus Lerdorf is known as the FATHER of PHP. PHP/FI 2.0 is an early and no LONGER supported version of PHP. PHP 3 is the SUCCESSOR to PHP/FI 2.0 and is a lot nicer. PHP 4 is the current generation of PHP, which uses the Zend ENGINE under the hood. PHP 5 uses Zend engine 2 which, among other things, offers many additional OOP features Rasmus Lerdorf is known as the father of PHP. PHP/FI 2.0 is an early and no longer supported version of PHP. PHP 3 is the successor to PHP/FI 2.0 and is a lot nicer. PHP 4 is the current generation of PHP, which uses the Zend engine under the hood. PHP 5 uses Zend engine 2 which, among other things, offers many additional OOP features |
|