Unterminated string literal( when data is full-width or too long) in php
<p>I'm not sure it is because of full-width or too long string, my web page will occur the problem when the string too long, and because the data is dynamic appended, so the data should be full-width since the other page that let user input their data is full-width( Japanese or Chinese). My html is:</p>

<pre><code>&lt;!DOCTYPE html PUBLIC "-/W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"&gt;
&lt;head&gt;
&lt;title&gt;Lomiro&lt;/title&gt; 
&lt;style type="text/css"&gt; 
&lt;!--
.style2 {font-family: Arial, Helvetica, sans-serif; font-size: 16px;}
--&gt;
a:link {
    text-decoration: none;
    color: #FFFFFF;
}
a:visited {
    text-decoration: none;
    color: #FFFFFF;
}
a:hover {
    text-decoration: none;
    color: #FFFFFF;
}
a:active {
    text-decoration: none;
    color: #FFFFFF;
}
body,td,th {
    font-size: 16px;
}
.style3 {color: #FFFFFF}
&lt;/style&gt;
&lt;script type="text/javascript"&gt; 
function addRow(i,id,names,addr,cell,cam,num,shop,pay,date)
{
    var tableis = document.getElementById("info");
    var last=(-1);
    var Tr = tableis.insertRow(last);
    var Td1 = Tr.insertCell(0);
    Td1.innerHTML="&lt;input type='text' readonly='readonly' style='cursor: default; width: 100px;' name='id"+i+"' id='id"+i+"' value='"+id+"' /&gt;";
    Tr.appendChild(Td1);
    var Td2 = Tr.insertCell(1);
    Td2.innerHTML='&lt;input type="text" readonly="readonly" style="cursor: default; width: 100px;" name="name'+i+'" id="name'+i+'" value="'+names+'" /&gt;';
    Tr.appendChild(Td2);
    var Td3 = Tr.insertCell(2);
    Td3.innerHTML='&lt;input type="text" readonly="readonly" style="cursor: default; width: 330px;" name="addr'+i+'" id="addr'+i+'" value="'+addr+'" /&gt;';
    Tr.appendChild(Td3);
    var Td4 = Tr.insertCell(3);
    Td4.innerHTML='&lt;input type="text" readonly="readonly" style="cursor: default; width: 90px;" name="cell'+i+'" id="cell'+i+'" value="'+cell+'" /&gt;';
    Tr.appendChild(Td4);
    var Td5 = Tr.insertCell(4);
    Td5.innerHTML='&lt;input type="text" readonly="readonly" style="cursor: default; width: 100px;" name="cam'+i+'" id="cam'+i+'" value="'+cam+'" /&gt;';
    Tr.appendChild(Td5);
    var Td6 = Tr.insertCell(5);
    Td6.innerHTML='&lt;input type="text" readonly="readonly" style="cursor: default; width: 80px;" name="num'+i+'" id="num'+i+'" value="'+num+'" /&gt;';
    Tr.appendChild(Td6);
    var Td7 = Tr.insertCell(6);
    Td7.innerHTML='&lt;input type="text" readonly="readonly" style="cursor: default; width: 100px;" name="shop'+i+'" id="shop'+i+'" value="'+shop+'" /&gt;';
    Tr.appendChild(Td7);
    var Td8 = Tr.insertCell(7);
    Td8.innerHTML='&lt;input type="text" readonly="readonly" style="cursor: default; width: 70px;" name="pay'+i+'" id="pay'+i+'" value="'+pay+'" /&gt;';
    Tr.appendChild(Td8);
    var Td9 = Tr.insertCell(8);
    Td9.innerHTML='&lt;input type="text" readonly="readonly" style="cursor: default; width: 70px;" name="date'+i+'" id="date'+i+'" value="'+date+'" /&gt;';
    Tr.appendChild(Td9);
}
function addRow2(i,shop,id,names,addr,cell,cam,num,pay,date)
{
    var tableis = document.getElementById("info");
    var last=(-1);
    var Tr = tableis.insertRow(last);
    var Td1 = Tr.insertCell(0);
    Td1.innerHTML='&lt;input type="text" readonly="readonly" style="cursor: default; width: 100px;" name="shop'+i+'" id="shop'+i+'" value="'+shop+'" /&gt;';
    Tr.appendChild(Td1);
    var Td2 = Tr.insertCell(1);
    Td2.innerHTML='&lt;input type="text" readonly="readonly" style="cursor: default; width: 100px;" name="id'+i+'" id="id'+i+'" value="'+id+'" /&gt;';
    Tr.appendChild(Td2);
    var Td3 = Tr.insertCell(2);
    Td3.innerHTML='&lt;input type="text" readonly="readonly" style="cursor: default; width: 100px;" name="name'+i+'" id="name'+i+'" value="'+names+'" /&gt;';
    Tr.appendChild(Td3);
    var Td4 = Tr.insertCell(3);
    Td4.innerHTML='&lt;input type="text" readonly="readonly" style="cursor: default; width: 330px;" name="addr'+i+'" id="addr'+i+'" value="'+addr+'" /&gt;';
    Tr.appendChild(Td4);
    var Td5 = Tr.insertCell(4);
    Td5.innerHTML='&lt;input type="text" readonly="readonly" style="cursor: default; width: 90px;" name="cell'+i+'" id="cell'+i+'" value="'+cell+'" /&gt;';
    Tr.appendChild(Td5);
    var Td6 = Tr.insertCell(5);
    Td6.innerHTML='&lt;input type="text" readonly="readonly" style="cursor: default; width: 100px;" name="cam'+i+'" id="cam'+i+'" value="'+cam+'" /&gt;';
    Tr.appendChild(Td6);
    var Td7 = Tr.insertCell(6);
    Td7.innerHTML='&lt;input type="text" readonly="readonly" style="cursor: default; width: 80px;" name="num'+i+'" id="num'+i+'" value="'+num+'" /&gt;';
    Tr.appendChild(Td7);
    var Td8 = Tr.insertCell(7);
    Td8.innerHTML='&lt;input type="text" readonly="readonly" style="cursor: default; width: 70px;" name="pay'+i+'" id="pay'+i+'" value="'+pay+'" /&gt;';
    Tr.appendChild(Td8);
    var Td9 = Tr.insertCell(8);
    Td9.innerHTML='&lt;input type="text" readonly="readonly" style="cursor: default; width: 70px;" name="date'+i+'" id="date'+i+'" value="'+date+'" /&gt;';
    Tr.appendChild(Td9);
}
function addRow3(i,date,id,names,addr,cell,cam,num,shop,pay)
{
    var tableis = document.getElementById("info");
    var last=(-1);
    var Tr = tableis.insertRow(last);
    var Td1 = Tr.insertCell(0);
    Td1.innerHTML='&lt;input type="text" readonly="readonly" style="cursor: default; width: 70px;" name="date'+i+'" id="date'+i+'" value="'+date+'" /&gt;';
    Tr.appendChild(Td1);
    var Td2 = Tr.insertCell(1);
    Td2.innerHTML='&lt;input type="text" readonly="readonly" style="cursor: default; width: 100px;" name="id'+i+'" id="id'+i+'" value="'+id+'" /&gt;';
    Tr.appendChild(Td2);
    var Td3 = Tr.insertCell(2);
    Td3.innerHTML='&lt;input type="text" readonly="readonly" style="cursor: default; width: 100px;" name="name'+i+'" id="name'+i+'" value="'+names+'" /&gt;';
    Tr.appendChild(Td3);
    var Td4 = Tr.insertCell(3);
    Td4.innerHTML='&lt;input type="text" readonly="readonly" style="cursor: default; width: 330px;" name="addr'+i+'" id="addr'+i+'" value="'+addr+'" /&gt;';
    Tr.appendChild(Td4);
    var Td5 = Tr.insertCell(4);
    Td5.innerHTML='&lt;input type="text" readonly="readonly" style="cursor: default; width: 90px;" name="cell'+i+'" id="cell'+i+'" value="'+cell+'" /&gt;';
    Tr.appendChild(Td5);
    var Td6 = Tr.insertCell(5);
    Td6.innerHTML='&lt;input type="text" readonly="readonly" style="cursor: default; width: 100px;" name="cam'+i+'" id="cam'+i+'" value="'+cam+'" /&gt;';
    Tr.appendChild(Td6);
    var Td7 = Tr.insertCell(6);
    Td7.innerHTML='&lt;input type="text" readonly="readonly" style="cursor: default; width: 80px;" name="num'+i+'" id="num'+i+'" value="'+num+'" /&gt;';
    Tr.appendChild(Td7);
    var Td8 = Tr.insertCell(7);
    Td8.innerHTML='&lt;input type="text" readonly="readonly" style="cursor: default; width: 100px;" name="shop'+i+'" id="shop'+i+'" value="'+shop+'" /&gt;';
    Tr.appendChild(Td8);
    var Td9 = Tr.insertCell(8);
    Td9.innerHTML='&lt;input type="text" readonly="readonly" style="cursor: default; width: 70px;" name="pay'+i+'" id="pay'+i+'" value="'+pay+'" /&gt;';
    Tr.appendChild(Td9);
}
function printOut(block)
{
    var value = block.innerHTML;
    var printPage = window.open("","printPage","");
    printPage.document.open();
    printPage.document.write("&lt;HTML&gt;&lt;head&gt;&lt;/head&gt;&lt;BODY onload='window.print();window.close()'&gt;");
    printPage.document.write("&lt;PRE&gt;");
    printPage.document.write(value);
    printPage.document.write("&lt;/PRE&gt;");
    printPage.document.close("&lt;/BODY&gt;&lt;/HTML&gt;");
}
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;table width="589" align="right" style="position: absolute; right: 0px; top: 0px; width: 589px;"&gt;
  &lt;tr&gt;
    &lt;td width="118" height="23" style="background-color: #3366CC;"&gt;&lt;div align="center" class="style2"&gt;&lt;a href="query.php" target="mainFrame"&gt;検索&lt;/a&gt;&lt;/div&gt;&lt;/td&gt;
    &lt;td width="118" style="background-color: #3366CC;"&gt;&lt;div align="center" class="style2"&gt;&lt;a href="addnew.php" target="mainFrame"&gt;顧客管理&lt;/a&gt;&lt;/div&gt;&lt;/td&gt;
    &lt;td width="118" style="background-color: #3366CC;"&gt;&lt;div align="center" class="style2"&gt;&lt;a href="shop.php" target="mainFrame"&gt;代理店管理&lt;/a&gt;&lt;/div&gt;&lt;/td&gt;
    &lt;td width="118" style="background-color: #3366CC;"&gt;&lt;div align="center" class="style2"&gt;&lt;a href="statistic.php" target="mainFrame"&gt;統計管理&lt;/a&gt;&lt;/div&gt;&lt;/td&gt;
  &lt;td width="118" style="background-color: #9966FF;"&gt;&lt;div align="center" class="style2"&gt;&lt;a href="output.php" target="mainFrame"&gt;会計管理&lt;/a&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;form method='post' action='exout.php'&gt;
&lt;div id='block' align='center'&gt;
2013/4/1~2013/4/11
総契約者DATA
&lt;table width='737' border='0' name='info' id='info'&gt;
&lt;tr&gt;
&lt;td align='center' bgcolor='#9999FF'&gt;Lomiro ID&lt;/td&gt;
&lt;td align='center' bgcolor='#9999FF'&gt;氏名&lt;/td&gt;
&lt;td align='center' bgcolor='#9999FF'&gt;住所&lt;/td&gt;
&lt;td align='center' bgcolor='#9999FF'&gt;携帯電話&lt;/td&gt;
&lt;td align='center' bgcolor='#9999FF'&gt;MAC&lt;/td&gt;
&lt;td align='center' bgcolor='#9999FF'&gt;型番&lt;/td&gt;
&lt;td align='center' bgcolor='#9999FF'&gt;代理店コード&lt;/td&gt;
&lt;td align='center' bgcolor='#9999FF'&gt;支払方法&lt;/td&gt;
&lt;td align='center' bgcolor='#9999FF'&gt;支払日&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;br/&gt;
&lt;input type='submit' id='output' name='output' value='Excel出力' /&gt;
&lt;input type='button' id='print' name='print' value='スキャンアウト' onclick='printOut(block)' /&gt;
&lt;/form&gt;
&lt;/body&gt;
&lt;script type='text/javascript'&gt;addRow('0','dayang','','','','','','','0','');

&lt;/script&gt;
&lt;/html&gt;
</code></pre>

<p>And if the data is full-width or too long, it will change line with failed way. like:</p>

<pre><code>    '9620001福島県須賀川市森宿
60-1'
</code></pre>

<p>The above line should be one line but it change line!</p>

<p>My web page is php, and I try several method to fix and nothing useful.<br>
The error of php code is:</p>

<pre><code>echo rtrim("&lt;script type='text/javascript'&gt;");
echo "addRow('";
echo $k;
echo "','";
echo $mail;
echo "','";
echo $name;
echo "','";
echo trim($addr);
echo "','";
echo $cell;
echo "','','','";
echo $shop;
echo "','";
echo $pay;
echo "','";
echo $date;
echo "');"."\n&lt;/scr";
echo "ipt&gt;"."\n";
$k++;
</code></pre>

<p>The data is fetch from database, and I see the data in database doesn't have any change line character.</p>

<p>The problem I guess is that the data appended is too long, and it is full-width.</p>

<p>I know the problem is similar to others, but I have tried any others' method and the problem still can't be solved.</p>

<p>I tried use 
</p>

<p>and delete that line, or let my php file be utf-8 encoding.</p>

<p>Let  tag be split like ''
......</p>

<p>Please help me!</p>
