Why issit that when i Fputs on a file, with multiple spaces strings, for example string = "A B C" with 5 spacing in each, when i read the file, thereis onlyone space?
any solutions to it??
How are you reading the file? In a browser? Remember how browsers render multiple spaces.
i uses pico to open the file?
it obviously is about html , so i would do something like :
<?php $string = 'A B C'; //replace every two spaces with 'space' + nbsp $string = str_replace(' ', ' ', $string); $f = fopen($file.'.html', 'w+'); fputs($f, $string); fclose($f); ?>
i uses fsockopen to open the remote .txt file i want to fputs lines with multiple string to the .txt file so that i can have it in a nice format u see something like
Prince 1 Princess 2 King 3
etc
<pre>
$var .= "Prince 1\n"; $var .= "Princess 2\n"; $var .= "King 1\n"; print "<pre>$var</pre>";
this script prints
...except that pico is a text editor. The text file only shows single spaces when opened in pico? Like I said, WFM - and in pico, too.
$fp=fopen('text.txt','w'); fputs($fp, 'A B C D'); fclose($fp);
Open text.txt in pico:
A B C D