I am getting white space at top and at bottom. I am getting confused. First I will show you what I have, and what I tried. But no luck...
Code works fine, but no luck at removing this space....
OK THIS IS ORG CODE
if($action == "change"){
$var11 = stripslashes( $news2 );
$file="../news2.php";
$fileopen=fopen ("$file","w");
fputs($fileopen, "$var11");
fclose($fileopen);
$res="$file has been saved <a href=\"main.php\">Go back</a>";
}
echo $res;
?>
<form method=post action=editnews2.php?action=change>
<textarea name="news2" rows="10" cols="70">
<?php
$fp = fopen('news2.php', 'r');
$str = fread($fp, filesize('news2.php'));
fclose($fp);
echo $str;
?>
</textarea><br><br>
<input type="submit" name=" Submit " value="Submit">
</form>
OK THIS IS WHAT I TRIED USING TRIM
<form method=post action=editnews2.php?action=change>
<textarea name="news2" rows="10" cols="70">
<?php
$fp = fopen('news2.php', 'r');
$str = fread($fp, filesize('news2.php'));
$trimmedTextString = trim($str);
fclose($fp);
echo $trimmedTextString;
?>
</textarea><br><br>
<input type="submit" name=" Submit " value="Submit">
</form>