Reply to strcmp problem

Your name:

Reply:


Posted by juicy on 11/18/57 11:43

I done a program to read text file, where content is

#Header#
name: Juicy
age: 25
@Header@
#Text#
user text here
@Text@
#End#
tel
fax
@End@
eof

And I read the text file

$filename = "/usr/local/file/rpt.txt";
$fp = fopen($filename, 'r');

$content = fgets($fp);
while(strcmp($content,"@End@")<>0) {

$content = fgets($fp);

if(strcmp($content, "#Text#")==0){ //not match
$strPretext .= $content;
}//end if
//end while


I should get the data from #Text# until one line before @End@, but I get
nothing, I found that the strcmp for #Text# always not match when it read
through whole file.


I cant find out what goes wrong. Please advise.

Thanks.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация