is the filename correct in windows?$filename="C:\\Documents and Settings\\Administrator\\Desktop\\file_name.csv";
How about the h http:///sss.ddd.ccc/aaa/fff/ss.csv
fopen -- Opens file or URL fgetcsv -- Gets line from file pointer and parse for CSV fields fputcsv -- Format line as CSV and write to file pointer fclose -- Closes an open file pointer -------------------------------------------------------------------------- http://cn.php.net/manual/zh/ref.filesystem.php //Chinese (Simplified) http://www.php.net/manual/en/ref.filesystem.php //English
I can not insert Chinese with this computer. Thanks for your understanding.
$filename="C:\\Program Files\\EasyPHP1-8\\www\\file.txt"; $lines=file($filename);$filenamenew="C:\\Program Files\\EasyPHP1-8\\www\\filenew.txt"; $fp=fopen($filenamenew, "w"); $count=sizeof($lines); for ($in=0; $in<$count; $in++) { $line=$lines[$in]; //$line=strip_tags($line); //if (strlen($line)>1 ||trim($line)!='') //here, I want to only display the line with character fwrite($fp, $line);
}echo '<pre>'; echo file_get_contents($filenamenew); echo '</pre>'; how you have any idea to fix this problem ======================================the file.txt format as followingaaaaaaaaaa bbbbbbbbbb ccccccccccI want to write it into at the filenew.txtaaaaaaaaaa bbbbbbbbbb cccccccccc
http:///sss.ddd.ccc/aaa/fff/ss.csv
fgetcsv -- Gets line from file pointer and parse for CSV fields
fputcsv -- Format line as CSV and write to file pointer
fclose -- Closes an open file pointer
--------------------------------------------------------------------------
http://cn.php.net/manual/zh/ref.filesystem.php //Chinese (Simplified)
http://www.php.net/manual/en/ref.filesystem.php //English
从楼主名字来看你是个中国人 !
汉语有什么不好,用英文.我相告诉你的是我们认识中文哦.
这里很少有外国人.不懂中文的外国人.
Thanks for your understanding.
$lines=file($filename);$filenamenew="C:\\Program Files\\EasyPHP1-8\\www\\filenew.txt";
$fp=fopen($filenamenew, "w"); $count=sizeof($lines);
for ($in=0; $in<$count; $in++)
{
$line=$lines[$in];
//$line=strip_tags($line);
//if (strlen($line)>1 ||trim($line)!='')
//here, I want to only display the line with character
fwrite($fp, $line);
}echo '<pre>';
echo file_get_contents($filenamenew);
echo '</pre>';
how you have any idea to fix this problem
======================================the file.txt format as followingaaaaaaaaaa
bbbbbbbbbb
ccccccccccI want to write it into at the filenew.txtaaaaaaaaaa
bbbbbbbbbb
cccccccccc