PHP Interview Question And Answare | PHP Interview Question And Answare for Fresher | Set 07

1.How can we destroy the session, how can we unset the variable of a session?
 Ans: session_unregister — Unregister a global variable from the current session
         session_unset — Free all session variables    

2.How can we destroy the cookie?
 Ans: Set the cookie in past.    

3.How many ways we can pass the variable through the navigation between the pages?
 Ans: GET/QueryString
          POST

4.What is the difference between ereg_replace() and eregi_replace()?
 Ans: eregi_replace() function is identical to ereg_replace() except that this ignores case distinction when matching alphabetic characters.eregi_replace() function is identical to ereg_replace()
except that this ignores case distinction when matching alphabetic characters.   

5.What are the different functions in sorting an array?
 Ans: Sort()
          arsort(),
          asort(),
          ksort(),
          natsort(),
          natcasesort(),
          rsort(),
          usort(),
          array_multisort(),
          uksort().

6.What is the difference between ereg_replace() and eregi_replace()?
 Ans: eregi_replace() function is identical to ereg_replace() except that it ignores case distinction when matching alphabetic characters.

7.How do I find out the number of parameters passed into function9. ?
 Ans: func_num_args() function returns the number of parameters passed in.

8.What is the purpose of the following files having extensions: frm, myd, and myi? What these files contain?
 Ans: 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,

9.If the variable $a is equal to 5 and variable $b is equal to character a, what’s the value of $$b?
 Ans: 100, it’s a reference to existing variable.

10.What is the difference between CHAR and VARCHAR data types?
 Ans: CHAR is a fixed length data type. CHAR(n) will take n characters of storage even if you enter less than n characters to that column. For example, “Hello!” will be stored as “Hello! ” in CHAR(10) column.
     
          VARCHAR is a variable length data type. VARCHAR(n) will take only the required storage for the actual number of characters entered to that column. For example, “Hello!” will be stored as “Hello!” in VARCHAR(10) column.

11.How can we encrypt and decrypt a data present in a mysql table using mysql?
 Ans: AES_ENCRYPT() and AES_DECRYPT()


Previous Next


:: Click the links below for similar type Questions and answers ::

Set 01 | Set 02  | Set 03  | Set 04  | Set 05  | Set 06  | Set 07  | Set 08  | Set 09 

0 comments:

Post a Comment

 
Design by Wordpress Theme | Bloggerized by Free Blogger Templates | coupon codes