PHP | SplFileObject getMaxLineLen() Function
Last Updated :
20 Dec, 2018
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
$file = new SplFileObject( "gfg.txt" );
var_dump( $file ->getMaxLineLen());
$file = new SplFileObject( __FILE__ );
var_dump( $file ->getMaxLineLen());
?>
|
Output:
int(0)
int(0)
Program 2:
<?php
$gfg = new SplFileObject( "gfg.txt" );
var_dump( $gfg ->getMaxLineLen());
$gfg ->setMaxLineLen(20);
var_dump( $gfg ->getMaxLineLen());
?>
|
Reference: http://php.net/manual/en/splfileobject.getmaxlinelen.php
Share your thoughts in the comments
Please Login to comment...