Explode function in PHP
<p>I have the following notepad file;</p>

<pre><code>dbName:              

tableName:       

numberOfFields:
</code></pre>

<p>I am trying to write a php app which assigns the value of dbName to $dbName, tableName to $tableName and numberOfFields to $numFields.</p>

<p>My code is:</p>

<pre><code>$handle = @fopen("config.txt", "r");
if ($handle) {
    while (!feof($handle)) {
        $buffer = fgets($handle, 4096);
        list($dbName, $tableName, $numFields) = explode(":", "$buffer");
    }
    fclose($handle);
}
</code></pre>

<p>however, ":" doesn't work as there are line breaks in between dbName and table Name. How do I explode $buffer, keeping the line breaks in the notepad file?</p>

<p>Thank you.</p>
