Reply to Re: fwrite() problem with length of a string

Your name:

Reply:


Posted by J.O. Aho on 12/21/05 13:55

nescio wrote:

> the problem is: sometimes a string appears on two lines, instead of one.
> as if there is a break;
>
> how is this possible?

Can be the program you use to read with that shows it as if there is a
linebreak. You should check this up with a hex editor and see if there are any
form of data between those two "lines".

Another thing that can make line break is that the sender has run it through a
word processor and got automatic line breaks on long rows.


> my question is:
> - is there a maximum that a line accepts, and when there is more information
> than the maximum allows, it
> starts a new line?

No, fwrite don't append any new lines
http://www.php.net/manual/en/function.fwrite.php

You can use strlen() to get the length of the string and use it as an argument
for fwrite(), this will disable magic_quotes_runtime

eg: " -> \"


> - how do i get al of the information of a varaible on one line?

fwrite(fp,$string);

or

fwrite(fp,$string,strlen($string));

But this requires of course that the data sent are all in one line, otherwise
you will need to start using ereg functions to remove line breaks, take a look
at http://www.php.net/manual/en/function.eregi.php



//Aho

[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

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