PHP | SplFileObject getMaxLineLen() Function
The SplFileObject::getMaxLineLen() function is an inbuilt function of Standard PHP Library (SPL) in PHP which is used to get maximum line length.
Syntax:
int SplFileObject::getMaxLineLen( void )
Parameters: This function does not accept any parameter.
Return values: This function returns the maximum length of line. The default value is set to 0.
Below Programs illustrate the SplFileObject::getMaxLineLen() function in PHP:
Program 1:
<?php // Create an SplFile Object $file = new SplFileObject("gfg.txt"); // Print Length var_dump($file->getMaxLineLen()); // Create an SplFile Object $file = new SplFileObject(__FILE__); // Print Length var_dump($file->getMaxLineLen()); ?> |
Output:
int(0) int(0)
Program 2:
<?php // Create an SplFile Object $gfg = new SplFileObject("gfg.txt"); // Print Length var_dump($gfg->getMaxLineLen()); // Set length $gfg->setMaxLineLen(20); var_dump($gfg->getMaxLineLen()); ?> |
int(0) int(20)
Reference: http://php.net/manual/en/splfileobject.getmaxlinelen.php
Recommended Posts:
- PHP | SplFileObject eof() Function
- PHP | SplFileObject flock() Function
- PHP | SplFileObject setMaxLineLen() Function
- PHP | SplFileObject fwrite() Function
- PHP | SplFileObject current( ) Function
- PHP | SplFileObject ftruncate() Function
- PHP | SplFileObject ftell() Function
- PHP | SplFileObject fgetc() Function
- PHP | SplFileObject fgets() Function
- PHP | SplFileObject fgetss() Function
- PHP | SplFileObject fstat() Function
- PHP | SplFileObject fread() Function
- PHP | SplFileObject rewind() Function
- PHP | SplFileObject fputcsv() Function
- PHP | SplFileObject seek() Function
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



