How to pass parameters from jQuery ajax into PHP function?

The data you send from jQuey to PHP is in the $_POST variable. So you can use $_POST['projectid'] inside your PHP function to get the data.