why my js variable not finding the php variable properly
<p>I am reading a text file . and then splitting it into by 100 words in an array named "$arrpg"  and then in my js code while i am loading it to js variable , the var is unable to get the array values properly.  if you don't mind please see  a link where i uploaded it for test purpose (<a href="http://leiame.patio.com.br/read/readf/muricoca" rel="nofollow">link</a>) </p>

<p>here my input text file is "  </p>

<blockquote>
  <p>A MUSICISTA E O GUERREIRO
  À noite, deitado, no escuro, não tenho forças para evitar o concerto da virtuose muriçoca. Ela vem dali até aqui na velocidade do som. Procuro capturá-la com a mão, ela -- vivace -- ...........................so many more</p>
</blockquote>

<p>"</p>

<p>my js code is</p>

<pre><code>    &lt;script type="text/javascript" charset="UTF-8"&gt;


$(document).ready(function() {




    var ind=0;
   var tempv1;
   var tempv2;


    var pages=&lt;?php echo json_encode((int)($page_num));?&gt;;

    var jsarr= &lt;?php echo json_encode($arrpg); ?&gt;;


    var wmap=&lt;?php 

    echo json_encode($word_map); ?&gt;;
    var myurl=&lt;?php echo json_encode($my_link.'write_comment/'.$file_name.'/'.$total_word.'/');?&gt;











     $('.more').each(function() {



        pages++;

           $(this).html(jsarr[ind]);

        tempv2= ' &lt;a class="link2" href="'+myurl+wmap[0]  + '"&gt;';


        if(pages!==1)
        {

            tempv1='&lt;span&gt;.... &lt;a href=""class="link1"&gt;Read more&lt;/a&gt;&lt;/span&gt;';
            tempv2='&lt;br&gt;&lt;br&gt;'+tempv2+'Stop reading&lt;/a&gt;';
            $('div.link1').html(tempv1);
            $('div.link2').html(tempv2);


        }
        else
        {


            tempv2='&lt;br&gt;&lt;br&gt;'+tempv2+'Please a feedback&lt;/a&gt;';

            $('div.link2').html(tempv2);


        }





            scroll();









        });   


    $(".link1").click(function(){


        ind++;


        $('div.more').append(jsarr[ind]);



        tempv2= '&lt;a class="link2" href="'+myurl+wmap[ind]  + '"&gt;';

        if(ind&lt;(pages-1) )
        {
            tempv1='&lt;span&gt;.... &lt;a href=""class="link1"&gt;Read more&lt;/a&gt;&lt;/span&gt;';
            tempv2='&lt;br&gt;&lt;br&gt;'+tempv2+'Stop reading&lt;/a&gt;';


            $('div.link1').html(tempv1);
            $('div.link2').html(tempv2);

        }
        else 
        {
            tempv2='&lt;br&gt;&lt;br&gt;'+tempv2+'Please a feedback&lt;/a&gt;';

            tempv1='';
            $('div.link1').html(tempv1);







            $('div.link2').html(tempv2);


        }



        scroll();

        return false;
    });
});



            function scroll(){
  $('html, body').animate({
    scrollTop: $("#ft").offset().top
  }, 0);
}



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

<p>in this code declaration of jsarr can't get the values properly. seeing the link u will realize more. please help.</p>

<p>after 1st edit</p>

<pre><code>`&lt;script type="text/javascript" charset="UTF-8"&gt;


$(document).ready(function() {




    var ind=0;
   var tempv1;
   var tempv2;


    var pages=5;

    var jsarr= [" A MUSICISTA E O GUERREIRO\r\n"," a m"," agudo violino. Cubro a\\norelha, sinto calor, descubro a orelha, escuto a muri"," da habilidosa\\ninstrumentista. Na manh"," palmas de\\nminhas m"," morta, rubronegra\\n-- na plan"];
    alert(jsarr);

    var wmap=[30,60,90,120,150,175];
    var myurl="http:\/\/leiame.patio.com.br\/read\/write_comment\/muricoca\/175\/"  











     $('.more').each(function() {



        pages++;

           $(this).html(jsarr[0]);

        tempv2= ' &lt;a class="link2" href="'+myurl+wmap[0]  + '"&gt;';


        if(pages!==1)
        {

            tempv1='&lt;span&gt;.... &lt;a href=""class="link1"&gt;Read more&lt;/a&gt;&lt;/span&gt;';
            tempv2='&lt;br&gt;&lt;br&gt;'+tempv2+'Stop reading&lt;/a&gt;';
            $('div.link1').html(tempv1);
            $('div.link2').html(tempv2);


        }
        else
        {


            tempv2='&lt;br&gt;&lt;br&gt;'+tempv2+'Please a feedback&lt;/a&gt;';

            $('div.link2').html(tempv2);


        }





            scroll();









        });   


    $(".link1").click(function(){


        ind++;


        $('div.more').append(jsarr[ind]);



        tempv2= '&lt;a class="link2" href="'+myurl+wmap[ind]  + '"&gt;';

        if(ind&lt;(pages-1) )
        {
            tempv1='&lt;span&gt;.... &lt;a href=""class="link1"&gt;Read more&lt;/a&gt;&lt;/span&gt;';
            tempv2='&lt;br&gt;&lt;br&gt;'+tempv2+'Stop reading&lt;/a&gt;';


            $('div.link1').html(tempv1);
            $('div.link2').html(tempv2);

        }
        else 
        {
            tempv2='&lt;br&gt;&lt;br&gt;'+tempv2+'Please a feedback&lt;/a&gt;';

            tempv1='';
            $('div.link1').html(tempv1);







            $('div.link2').html(tempv2);


        }



        scroll();

        return false;
    });
});



            function scroll(){
  $('html, body').animate({
    scrollTop: $("#ft").offset().top
  }, 0);
}



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