The-Master®
New Member
I have the following notepad file;\[code\]dbName: tableName: numberOfFields:\[/code\]I am trying to write a php app which assigns the value of dbName to $dbName, tableName to $tableName and numberOfFields to $numFields.My code is:\[code\]$handle = @fopen("config.txt", "r");if ($handle) { while (!feof($handle)) { $buffer = fgets($handle, 4096); list($dbName, $tableName, $numFields) = explode(":", "$buffer"); } fclose($handle);}\[/code\]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?Thank you.