FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


How to fwrite or remove /n at the last entry





SlovenianBoy
Please, look at the picture and give me some tips how to use fwrite properly


mahirharoon
SlovenianBoy wrote:
Please, look at the picture and give me some tips how to use fwrite properly



ws blocked here,the code i use
Code:

<?php
$fiename = the file here
$handle = fopen("", "a");
$contents = fread($handle, filesize($filename));
imagefree
mahirharoon wrote:
SlovenianBoy wrote:
Please, look at the picture and give me some tips how to use fwrite properly



ws blocked here,the code i use
Code:

<?php
$fielname = the file here
$handle = fopen("", "a");
$contents = fread($handle, filesize($filename));


i think it should be

Code:

<?php
$fielname = the file here
$handle = fopen("", "a");
$contents = fread($handle, (filesize($filename)-1));


if not, please correct me
Star Wars Fanatic
You also have a slight bug in your code, there, you misspelled a variable name, it should either be:

Code:
<?php
$filename = the file here
$handle = fopen("", "a");
$contents = fread($handle, filesize($filename));
?>


or

Code:
<?php
$fielname = the file here
$handle = fopen("", "a");
$contents = fread($handle, filesize($fielname));
?>
Related topics
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.