Re: explode, split, or what?
| From: | Steve Keller | Date: | Thu, 19 Jun 2003 22:59:29 +0000 |
| Subject: | Re: explode, split, or what? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-152252@lists.php.net to get a copy of this message | ||
At 6/19/2003 10:41 PM, Kyle Babich wrote:
Inside of another file I'm trying to read setup.txt into $rawSetupData and explode that with \r\n's
into an array called $setupData.Why on earth? http://us4.php.net/file
<?php if (file_exists("setup.txt")) { $rawSetupData = readfile("setup.txt"); $setupData = explode("\r\n", $rawSetupData); echo $setupData[0]; } else echo "Error opening \"setup.txt\""; ?>No no nonono <? if ($file_exists("setup.txt")) { $setupData = file("setup.txt"); } else { echo 'Error opening "setup.txt"'; } ?> -- S. Keller UI Engineer The Health TV Channel, Inc. (a non - profit organization) 3820 Lake Otis Pkwy. Anchorage, AK 99508 907.770.6200 ext.220 907.336.6205 (fax) Email: skeller@healthtvchannel.org Web: www.healthtvchannel.org