php - What does this get_text function do? -


panique did great job answering question on thread: php directory list remote server

but created function don't understand @ , hoping sort of explanation. example, what's random 8192 number?

function get_text($filename) {      $fp_load = fopen("$filename", "rb");      if ( $fp_load ) {              while ( !feof($fp_load) ) {                 $content .= fgets($fp_load, 8192);             }              fclose($fp_load);              return $content;      } } 

it loads file path in $filename , returns it's content. 8192 not random. means read file in chunks of 8kb.

the while loop runs long file wasn't entirely read. each iteration adds latest 8kb of file $content returned @ end of function.


Comments

Popular posts from this blog

javascript - How to get current YouTube IDs via iMacros? -

c# - Maintaining a program folder in program files out of date? -

emulation - Android map show my location didn't work -