Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to the use file_get_contents() in PHP ?

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 136
    Comment on it

    Welcome to findnerd, today we are going to discuss How the use file_get_contents() in PHP ?

    Fistly let know what is use of file_get_contents() ?

    The file_get_contents() basically reads a file into a string.
    So we can say that file_get_contents Reads entire file into a string.
    The file_get_contents() is a memory mapping techniques, if this is supported by the server,
    to enhance performance.

    syntax of file_get_contents()

    file_get_contents(path);
    

    You can take reference of bellow example:

    <?php
    //here call file_get_contents() and pass path
    echo file_get_contents("file.txt");
    ?>
    

    The output of the code above will be:

    Hi all welcome to findnerd 

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: