You can use the fgets()
function to read the file line by line:
$handle = fopen("inputfile.txt", "r");
if ($handle) {
while (($line = fgets($handle)) !== false) {
// process the line read.
}
fclose($handle);
}
Related Contents:
- Get Specific Columns Using “With()” Function in Laravel Eloquent
- Getting HTTP code in PHP using curl
- Is there a code obfuscator for PHP? [closed]
- Do login forms need tokens against CSRF attacks?
- Nullable return types in PHP7
- PHP Get all subdirectories of a given directory
- Where is the php.ini file on a Linux/CentOS PC? [duplicate]
- How to force composer to reinstall a library?
- How to print SQL statement in codeigniter model
- How to add a new method to a php object on the fly?
- Laravel stylesheets and javascript don’t load for non-base routes
- How to get a form input array into a PHP array
- Passing $_POST values with cURL
- Symfony 2 EntityManager injection in service
- Mysteriously empty $_POST array
- Install APC RedHat
- Can I parameterize the table name in a prepared statement? [duplicate]
- How to check if curl is enabled or disabled
- laravel No supported encrypter found. The cipher and / or key length are invalid
- Get parent directory of running script
- Why does 1234 == ‘1234 test’ evaluate to true? [duplicate]
- PHPUnit best practices to organize tests
- How to build a RESTful API?
- Can I “Mock” time in PHPUnit?
- How to change public folder to public_html in laravel 5
- Force file download with php using header()
- Destructuring assignment in php for objects / associative arrays
- Symfony2: how to get all entities of one type which are marked with “EDIT” ACL permission?
- Can’t access global variable inside function
- How to define a Laravel route with a parameter that contains a slash character
- Facebook SDK returned an error: Cross-site request forgery validation failed. The “state” param from the URL and session do not match
- how to make New lines in a cell using phpexcel
- How to add an ORDER BY clause using CodeIgniter’s Active Record methods?
- Upgrading PHP on CentOS 6.5 (Final)
- Add a new line to a CSV file
- Check If a Column Exists in Laravel Migration File
- Running a Zend Framework action from command line
- Why does datetime->days always returns a positive number
- Redirecting to previous page after login?
- Login to remote site with PHP cURL
- Relative path not working in cron PHP script
- Inserting created_at data with Laravel
- Is there a limit in PHP to the length of a variable name or function name?
- Doctrine 2 update from entity
- Best way to list Alphabetical(A-Z) using PHP
- php interactive shell doesn’t have any output?
- PHP: How to use monolog to log to console (php://out)?
- How to use Laravel Passport with a custom username column
- Calling a particular PHP function on form submit
- PHP order array by date? [duplicate]