RE: [PHP] explode, split, or what?
| From: | Sævar Öfjörð | Date: | Thu, 19 Jun 2003 22:51:16 +0000 |
| Subject: | RE: [PHP] explode, split, or what? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-152251@lists.php.net to get a copy of this message | ||
why don't you just do this?
***
<?php
if(file_exists("setup.txt")){
$lines=file("setup.txt");
echo stripslashes($lines[0]);
}
else echo "Error opening \"setup.txt\"";
?>
***
file() returns the file in an array, each line as new value, so line nr.
1 is $line[0], line nr. 2 is $line[1] etc...
I added stripslashes() on the output so that you won't get "John\'s X
Log"
Sævar - ICELAND