Sorry guys, its OK now. I was checking an earlier output (too many
interruptions at work).

Ta.

George

> -----Original Message-----
> From: George Pitcher [mailto:[EMAIL PROTECTED]
> Sent: 29 March 2004 11:31 am
> To: [EMAIL PROTECTED]
> Subject: [PHP-WIN] Stripping returns
>
>
> Hi all,
>
> I'm using php to create java classes for database access. I have a file (a
> few in fact) containing a list of fieldnames, one per line.
>
> So I open the file and read it line by line and create the java code.
> Opening reading and closing is repeated for the several stages of
> definition
> and setting methonds etc.
>
> The problem is that as well as reading the fieldname, it is adding a
> 'return' at the end of it. It wouldn't take long to clean up but I've got
> about 20 of these classes to create and some have more than 300 fields
> (after normalisation).
>
> I read the file like so:
> =============================================
> $fd = fopen ($filename, "r");
> while (!feof ($fd)) {
>     $buffer = fgets($fd, 4096);
>     $buffer = str_replace("\n","",str_replace("\r","",$buffer));
> <<<< How I
> tried to sort it
>     $content.= "\tprivate String _".$buffer." = \"\";\r\n";
> }
> fclose($fd);
> =============================================
> Producing :
> - - - - - - - - - - - - - - - - - - - - - - -
>       private String _bl_serials
>  = "";
> - - - - - - - - - - - - - - - - - - - - - - -
>
> It does build the code nicely apart from this one flaw.
>
> Any suggestions?
>
> MTIA
>
> George in Oxford
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to