Why do you want PHP for that,try this:
function copy(inElement) {
if (inElement.createTextRange) {
var range = inElement.createTextRange();
if (range)
range.execCommand('Copy');
} else {
var flashcopier = 'flashcopier';
if(!document.getElementById(flashcopier)) {
var divholder = document.createElement('div');
divholder.id = flashcopier;
document.body.appendChild(divholder);
}
document.getElementById(flashcopier).innerHTML = '';
var divinfo = '<embed src="_clipboard.swf" FlashVars="clipboard='+encodeURIComponent(inElement.value)+'" width="0" height="0" type="application/x-shockwave-flash"></embed>';
document.getElementById(flashcopier).innerHTML = divinfo;
}
}
<form name="formtocopy" action="" >
<textarea name="texttocopy" disabled="disabled">
A whole bunch of text here that will be copied.
</textarea>
<br>
<a href="javascript:copy(document.formtocopy.texttocopy);">Copy the Text!</a>
</form>