Add characters at the beggining of a textarea exported line
Posted: Mon Oct 30, 2006 8:14 pm
is there any way to add a
at the beginning of a line that came out of a textarea with php?
this is my code
The code that the php exports in case there is more than one line in the textarea is this:
All i need in order to make it work is the last ' to be at the beginning of the next line, like this:
That way the js would be able to read it. Thank you very much in advanced,
Yuval
Code: Select all
'this is my code
Code: Select all
$myFile = "yourfile.js";
$information = $_POST['info'];
$fh = fopen($myFile, 'w') or die("can't open file");
$information = nl2br($information);
$information = str_replace("<br />","<br />'+", $information);
$insertinfo = "myText="."'<h5><center>".$information."</center></h5>'";
fwrite($fh, $insertinfo);
fclose($fh);
echo $information;Code: Select all
myText='<h5><center>this<br />'+'
is a test</center></h5>'Code: Select all
myText='<h5><center>this<br />'+
'is a test</center></h5>'Yuval