How to read a new line from a text file in php?

Yepkoo

Yepkoo
Staff member
Code:
    $file_check = 'folder/mytext.text';
    
    if (file_exists($file_check))
    {
        $handle = fopen($file_check, "r");
        if ($handle) {
            while (($line = fgets($handle)) !== false)
            {
                echo $line.'<br>';
            }
        }
    }
 
Top