title: Syntax Error : Unexpected Token ILLEGAL
body: <p>I am trying to send array parameter to jquery method. I tried to send as a json value. but error occured : unexpected token illegal and it does not show where error is. </p>
  
  <p>How can i send php array value to jquery function as a parameter? </p>
  
  <p>in users.php -></p>
  
  <p>php part : </p>
  
  <pre><code>$objUserStatistics = new UserStatistics;
  $user_groups = $objUserStatistics-&gt;userGroups($id);
  $json_user_groups = json_encode($user_groups);
  </code></pre>
  
  <p>link :</p>
  
  <pre><code>&lt;li&gt;&lt;a href="javascript:void(0);" onclick="$.show_user_groups('&lt;?=$json_user_groups?&gt;');" data-placement="bottom" data-toggle="tooltip" class="tooltips" data-original-title="Katıldığı Grup Sayısı"&gt;&lt;i class="fa fa-users"&gt;&lt;/i&gt; &lt;?=count($user_groups)?&gt;&lt;/a&gt;&lt;/li&gt;
  </code></pre>
  
  <p>in users.js -></p>
  
  <p>jquery :</p>
  
  <pre><code>$.show_user_groups = function(user_groups_val) {
          var user_groups = "";
          for (var i = 0; i &lt; user_groups_val.length; i++) {
              user_groups += '&lt;img src="'+user_groups_val.img_path+'" /&gt; &lt;h5&gt;'+user_groups_val.name+'&lt;/h5&gt;';
          }
          $("#myModalLabel").html("Katıldığı Gruplar");
          $(".modal-body").html(user_groups);
          $("#popup_link").trigger("click");
      }
  </code></pre>
  
  <p>how it (link) look like in browser's source code :</p>
  
  <p><a href="https://i.stack.imgur.com/C3OrW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/C3OrW.png" alt="enter image description here"></a></p>