1. Question:What is the most convenient hashing method to be used to hash passwords? 

    Answer
    It is preferable to use crypt() which natively supports several hashing algorithms or the function hash() which supports more variants than crypt() rather than using the common hashing algorithms such as md5, sha1 or sha256 because they are conceived to be fast. hence, hashing passwords with these algorithms can vulnerability.






    1. Report
  2. Question:What is the difference between ereg_replace() and eregi_replace()?

     

    Answer
    ereg_replace: The ereg_replace() function operates to finding and replacing a pattern with a replacement string.

    eregi_replace : The eregi_replace() function operates exactly like ereg_replace(), except that the search for pattern in
    string is not case sensitive.







    1. Report
  3. Question:What is the static variable in function useful for? 

    Answer
    A static variable is defined within a function only the first time and its value can be modified during function calls as follows:
    <?php 
    function testFunction() { 
     static $testVariable = 1;
     echo $testVariable; 
     $testVariable++; 
    } 
    testFunction();        //1 
    testFunction();        //2 
    testFunction();        //3 
    ?>






    1. Report
  4. Question:Which cryptographic extension provide generation and verification of digital signatures? 

    Answer
    The PHP-openssl extension provides several cryptographic operations including generation and verification of digital signatures.






    1. Report
  5. Question:What are the different functions in sorting an array? Discuss them?

     

    Answer
    array_reverse():    reverses an array’s element order.

    array_flip(): reverses the roles of the keys and their corresponding values.
        
    sort(): sorts an array, ordering elements from lowest to highest value.

    rsort(): sorts array items in reverse (descending) order.

    asort() : sorting an array in ascending order, except that the key/value correspondence is maintained.

    arsort(): it sorts the array in reverse order maintained key/value co-relation.







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