Post Reply 
PHP Problem
Author Message
ZiNgA BuRgA
Smart Alternative

Posts: 17,022.2988
Threads: 1,174
Joined: 19th Jan 2007
Reputation: -1.71391
E-Pigs: 446.1274
Offline
Post: #3
RE: PHP Problem
If I recall correctly, Windows breaks newlines with \r\n, so exploding on \n will keep all the \r's in place.

I wouldn't fopen() all the time during the loop (though if this is a personal script, shouldn't be an issue).  You should also escape \ with \\.

PHP Code:
1
2
3
4
5
6
7
8
$f = fopen("E:\\USERS\\pcminusmulti7\\www\\undergroundz\\file.txt", "a");
while($info = mysql_fetch_array( $data ))
{
$add = "{$info['image']} {$info['find']}\n";
$outputs = str_replace("images/smilies/", " ", $add); // replace messy paths in array before we write it to file
fwrite($f, $outputs);
}
fclose($f);

(This post was last modified: 06/08/2008 05:41 PM by ZiNgA BuRgA.)
06/08/2008 05:39 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 


Messages In This Thread
PHP Problem - MaDc0w - 06/08/2008, 07:22 AM
RE: PHP Problem - MaDc0w - 06/08/2008, 10:28 AM
RE: PHP Problem - ZiNgA BuRgA - 06/08/2008 05:39 PM
RE: PHP Problem - MaDc0w - 06/08/2008, 10:49 PM
RE: PHP Problem - ZiNgA BuRgA - 06/08/2008, 10:53 PM
RE: PHP Problem - MaDc0w - 08/08/2008, 04:10 AM
RE: PHP Problem - ZiNgA BuRgA - 09/08/2008, 11:26 PM

Forum Jump:


User(s) browsing this thread: 2 Guest(s)

 Quick Theme: