SCORM packages are designed to be static/self-contained content. You cannot add PHP to SCORM packages.
You could potentially use AICC HACP by setting up a server that hosts the content and uses AICC HACP to communicate results etc with the LMS but I haven't seen any useful documentation on how to do this on your own.