For example:
$(document).ready(function(){ $(\'.selector\').click(function(){ }); });
Sure, as long as you keep in mind that PHP code will be executed by the server before the page is sent out. Other than that, have fun.