1. Question:What is constant? How can you declare a constant? 

    Answer
    A constant is a value that cannot be modified throughout the execution of a program. Constant are declare by using the define() function.Its prototype follows:
    
    boolean define(string name, mixed value)Example
    define("PI",3.14159);
    echo PI; //returns 3.14159






    1. Report
  2. Question:Which functions are used to add file in a script?

     

    Answer
    PHP offers four function for including files into applications. These are:

    include(), require(), include_once(), require_once().






    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 are the types of key of array?

     

    Answer
    Each array consists of two components:  key and a value. Keys can be numerical or associative. Numerical key use numeric value and associative key use string value.







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