Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function get_data_simple($source_file = 'source.txt')
- {
- $file_size = filesize($source_file);
- $source_fh = fopen($source_file, 'r');
- do {
- fseek($source_fh, rand(0, $file_size - 1));
- fgets($source_fh);
- $result = fgets($source_fh);
- } while (!trim($result));
- fclose($source_fh);
- return $result;
- }
- $data = get_data_simple();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement