You can (theoretically anyways) reference a php file in a script-tag, so long, as it returns valid JS code, ideally with the appropriate mime type.
The a-tag question is a bit beyond me – yes, you can link to a php-file directly; it should most likely return HTML markup then.