title: How to call a php function like in codeigniter using ajax?
body: <p>This one is very simple. In <code>codeigniter</code> I can have an ajax call like: </p>
  
  <pre><code>    $.ajax({
          type: "POST",
          url: base_url + "index.php/mycontroller/myfunction"
         //so in mycontroller.php  ^ there is function myfunction ()
          data:{id : id},
          success:function(data){
  
           };
         })
  </code></pre>
  
  <p>Since <code>class Mycontroller extends CI_Controller</code>. <br />
  So how can I do that in <code>raw PHP</code> if I have <code>posted.php</code>, how can I extend this file in order for me to call a function like this:</p>
  
  <pre><code>    &lt;?php
          function test(){
             echo 'Hello World!';
           }
  </code></pre>
  
  <p>What i'm thinking is like:</p>
  
  <pre><code>    $.ajax({
          type: "POST",
          url: "posted.php/test", //go to posted.php and call test function if possible
          data:{id : id},
          success:function(data){
  
           };
         })
  </code></pre>
  
  <p>But this one is not working. So any help?</p>