title: Passing long string in javascript argument
body: <p>I have a php page which i have array of values with long values.</p>
  
  <p>I gave to pass this array in a javascript function like this</p>
  
  <p>$canswer is an array 
  I am imploding that and passing as arguments as follows,</p>
  
  <pre><code>$cans=implode(',',$canswer);
  echo "&lt;input type='checkbox' name='q1' id='1' onclick=\"save_answer('1','$cans')\"&gt;";
  </code></pre>
  
  <p>This code is working for short values in array.When I have long values in array,onclick is not working.When I tried to see view source,I saw the array values cut off in the page.</p>
  
  <p>I have tried the following code to give quotes for each values.But this also not works.</p>
  
  <pre><code>$correctanswer1="'" . implode("','", $correctanswer) . "'";echo $correctanswer1; 
  </code></pre>
  
  <p>Regards,
  Rekha</p>