Uncaught SyntaxError Unexpected Token illegal javascript with txt file
<p>I'm testing a script to automate advertisement read from a txt file) i want to use this because it was the one i already had and was working and only needed a few changes, however, something stopped working and i dont know what's wrong, i'm checking the output and everthing seems fine on the javascript but for some reason it doesn't work, it comes with unexpected token illegal and with the uncaught syntax error 
below is the code. Any Help is appreciated </p>

<p>PHP/javascript combined code </p>

<pre><code>&lt;?php 
    $adsf = "test.txt";
    $count = 0;
    $frd = fopen ($adsf,'r');
    $artest = array();
    $artest2 = array();
    $artest3 = array();
      while(!feof($frd))
       {

         $artest[$count] = fgets($frd);
         $count++;
        }
      fclose($frd);


      $t = 0;
      while($t &lt; $count)
        {
        $artest2[$t] = str_replace("\n" ,'', $artest[$t]);
          $artest3[$t] ="\"".$artest2[$t]."\", ";

          $t++;
        }    





          unset($artest3[$t - 1]);
          shuffle($artest3);
          $t = 0;
         while ($t &lt; $count)
           {

            $jsr = $jsr.$artest3[$t - 1];
            $t++;

            }

               //$jsr. = "\"test 1 test 2 test 3\", ";
            $jsr = $jsr." \"Advertise Here come to Lot 28 or Click &lt;a href=\\\"pub.php\\\" target=\\\"_blank\\\"&gt;HERE&lt;/a&gt; For More Information\" ";
       ?&gt;


             var avs = new Array ( &lt;?echo $jsr; ?&gt;);

             //var cron = 60;
              var sub = 0;
             function show5(){
                if (!document.layers&amp;&amp;!document.all&amp;&amp;!document.getElementById)
                return




               //change font size here to your desire
               myclock="&lt;font size='2' face='Arial' &gt;&lt;b&gt;"+avs[sub]+"&lt;/b&gt;&lt;/font&gt;"
              if (document.layers){
                  document.layers.liveclock.document.write(myclock)
                  document.layers.liveclock.document.close()
                  }
                 else if (document.all)
                   liveclock.innerHTML=myclock             
                   else if (document.getElementById)
                    document.getElementById("liveclock").innerHTML=myclock

                    ;
                  sub++;

                  if(sub &gt; &lt;? echo $count - 1; ?&gt;)
                   {
                      sub = 0;

                       }
                   setTimeout("show5()",5000)
                 }


             window.onload=show5
</code></pre>

<p>and the  problem comes on the array, if i put nothing on the txt file everythng works ok but if i try tiping any thing, used to be working but now comes with the "uncaught syntax error unexpected token illegal" and i checked the quotes and are fine. </p>
