Load File into String





2
Date Submitted Tue. Sep. 12th, 2006 8:00 AM
Revision 1 of 1
Beginner dogo
Tags File | String
Comments 0 comments
This function loads an File into an String.

    /**
    * Method load File into an String.
    *
    * Method load File into an String.
    *
    * @return string | false
    * @access public
    */
   
    function loadFileToString($File=null) {
        // If file exists load file into String.
        if(file_exists($File)) {
            return implode('',file($File));
        } else {
            return false;
        } // End if-else
    } // End function
 

Wolfgang F.

Comments

There are currently no comments for this snippet.

Voting