references:joomla.framework:filesystem:jfile-readread
Reads the contents of a file. If the current user has permission and safe mode is turned off, or the protocol is HTTP (i.e. the file name starts with http://) then this function will use the PHP fopen function. Otherwise, the function will use ftp (if enabled) to read the file. The function returns a string containing the contents of the file if successful. Otherwise, the function returns false and may raise a warning using the JError class. Syntaxstring read ( $filename, $incpath )
ExamplesExample: This example reads the robot.txt file. Example echo JFile::read( 'robots.txt' ); which might produce something like: Result User-agent: * Disallow: /administrator/ Disallow: /cache/ Disallow: /components/ Disallow: /editor/ Disallow: /help/ Disallow: /images/ Disallow: /includes/ Disallow: /language/ Disallow: /mambots/ Disallow: /media/ Disallow: /modules/ Disallow: /templates/ Disallow: /installation/ Discussion |


