There is more to signing than what falko is offering, what happens with domain keys is actually a cryptographic procedure, you have two keys the public and private key, the mail gets signed using a private key, and the recipient then verifies the email using the public key in DNS.
The header that is added is a values obtained by signing the email message
openssl dgst -sign rsa.private -sha1 <input.file
The problem is this value will be incorrect as the email has not been handed to the MTA yet, the MTA could modify the format of the email meaning all your emails will be rejected at the destination as the verification will fail due to modification by the MTA.
There are option two options i recommend
1. Point PHP to use an MTA and let the MTA do the signing
2. Use a PHP class that uses SMTP instead of using the mail command.
Take a read at the RFC's if you want to get more clued up on it.