1. Question:What are the abstract class and interface?

     

    Answer
    Abstract class:  An abstract class is a class that really isn’t supposed to ever be instantiated but instead serve as a base class to be inherited by other classes. Syntax->
             abstract class Class_name{
                 //insert attribute definitions here.
                 //insert method definitions here.
             }   
    Interface: An interface defines a general specification for implementing a particular service,   
                   declaring the required functions and constants without specifying exactly how it must be      
                   implemented. In PHP, an interface is created like so :
             Interface  InterfaceName{
    CONS 1;
    ………..
    CONS N;
    function methodName1();
    ……………………………………..
    function methodNameN();  
           } 






    1. Report
  2. Question:What are the encryption techniques in PHP? 

    Answer
    PHP implements the MD5 hash algorithm using the md5() function,
    eg : $encrypted_text = md5 ('password');






    1. Report
  3. Question:How to create an PHP array of a group of items inside an HTML form? 

    Answer
    We can create input fields with same name for "name" attribute with squire bracket at the end of the name of the name attribute, It passes data as an array to PHP super global. 
    For instance :
    
    <input name="MyArray[]" />  
    <input name="MyArray[]" />  
    <input name="MyArray[]" />






    1. Report
  4. Question:What are passing arguments by reference and passing arguments by value? 

    Answer
    By reference: When we pass an argument by reference, we pass a pointer to the value in memory. The function operates on the argument. When a function changes the value of an argument passed by reference,the original value changes.By value: When we pass an argument by value, we pass a copy of the value in memory. The function operates on the copy. This means that when a function changes the value of an argument passed by value, the effect is local to that function; the copy changes but the original value in memory is not affected.






    1. Report
  5. Question:What is recursive function? 

    Answer
    A recursive function is a function that calls itself during its execution. This enables the function to repeat itself several times, outputting the result and the end of each iteration. Below is an example of a recursive function. 

    function Count (integer N)    
    if (N <= 0) return "Must be a Positive Integer";    
    if (N > 9) return "Counting Completed";    
    else return Count (N+1);
    end function






    1. Report
Copyright © 2025. Powered by Intellect Software Ltd