FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » File read-in issue
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: File read-in issue [message #170113 is a reply to message #170111] Mon, 11 October 2010 06:55 Go to previous messageGo to previous message
Chuck Anderson is currently offline  Chuck Anderson
Messages: 63
Registered: September 2010
Karma:
Member
Jason Rubenstein wrote:
> I am reading a set of strings in from a file, which are separated by
> newlines. When I compare the variable to the string it returns that
> the string is not equal, even though by appearance it is. I am sure
> that there are some non displayable characters in there, but don't
> know how to fix this.
>
> Here is some sample code
>
> The other file is just a form and I know it's working fine.
>
> <?php
> $file = fopen("pass.txt", "r") or exit("Unable to open file");
> $auth = filter_var($_POST["auth"], FILTER_SANITIZE_STRING);
> while (!feof($file)) {
> $current_Line = fgetss($file);
>

Try:

$current_Line = trim(fgetss($file));

--
*****************************
Chuck Anderson • Boulder, CO
http://www.cycletourist.com
Turn Off, Tune Out, Drop In
*****************************
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Manage Iis log file from php
Next Topic: Manage Iis log file fom php
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Wed Nov 27 01:14:02 GMT 2024

Total time taken to generate the page: 0.04401 seconds