title: How to put PHP script in JS?
body: <p>I have a page that allow users to access it. This page have certain things that not allow <code>user</code> to see that particular thing, For my case, user is unable to edit <code>edit()</code> or view this function, so I want to hide it by putting below code in JS because I am using function on this link.</p>
  
  <p>I already enabled Session in PHP page like this <code>&lt;?php session_start(); ?&gt;</code></p>
  
  <p>And I try this putting this PHP in JS inside Datatables function. The dataTable function is working fine. Just the PHP is not working.</p>
  
  <pre><code>{ data : "project_id",
      render: function(data) {
      return  "&lt;span onclick='view()'&gt;&lt;/span&gt;&amp;nbsp;"+    // This is allow to user and admin level
              "&lt;?php 
                if ($_SESSION['user_privilege'] == 'Admin') { ?&gt;
                   &lt;span onclick='edit()'&lt;/span&gt;
               &lt;?php } ?&gt;";   // This is allow for admin level only
      }
  }
  </code></pre>