title: Help needed in writing a PHP Function
body: <p>Here is my code</p>
  
  <p>P.S get_bloginfo('siteurl') is a wordpress function and it return site url</p>
  
  <p>What this code do is
  Let suppose we go to a page in wordpress</p>
  
  <p><a href="http://www.xyz.com/apage" rel="nofollow">http://www.xyz.com/apage</a></p>
  
  <p>'apage' is a page which is not created yet in WP but we are displaying some custom function on this URL instead of a 404 Error.</p>
  
  <p>What problem I have is I am unable to send my 3 parametres which I have added in custom_page function to the testfuction.Please help me in passing the parametres. Please see the code below.</p>
  
  <pre><code>function custom_page(){
  
      $numargs = func_num_args(); //Total Number of arguments
      $subarg = $numargs - 2; // Number of arguments for the function we are going to call(i-e testfunction()). Right now the total sub arguments are 3 i-e 'testing','get_bloginfo',get_bloginfo('siteurl')
  
      $function = func_get_arg(0);
      $current_url = (!empty($_SERVER['HTTPS'])) ? 'https://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'] : 'http://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; 
      $url = str_replace(get_bloginfo('siteurl'),'',$current_url);
      if($url == '/'.func_get_arg(1)){
  
          $function();
          exit;
      }
  }
  
  function testfunction($a,$b,$c){
      print $a //this should print testing;
      print $b //this should print get_bloginfo
      print $c //this should print the result of get_bloginfo function
  
  }
  custom_page('testfunction','apage','testing','get_bloginfo',get_bloginfo('siteurl'));
  </code></pre>