PHP operates the MACOS clipboard. Of course, this can not be B/s mode, the operation of the client Agent (browser system) of the Clipboard. b/S structure we can only use JAVASCRIPT or flash to operate, for PHP can only operate the service side.
This will be done by calling the system MACOS under the pbcopy, pbpaste implementation of the operation of the Clipboard.
Pbcopy takes the standard input and places it in the specified pasteboard. If no pasteboard is specified, the general pasteboard would be used by default. The input is
Placed in the Pasteboard as plain text data unless it begins with the encapsulated PostScript (EPS) file header or the Ric H-Text Format (RTF) file header, in which case
It is placed in the pasteboard as one of those data types.
Pbpaste removes the data from the pasteboard and writes it to the standard output. It normally looks the plain text in the Pasteboard and writes
Standard output; If no plain text data is in the pasteboard it looks for encapsulated PostScript; If no EPS is present it looks for Rich Text. If none of those types
Is present in the pasteboard, Pbpaste produces no output.
Take a look at the simple use of the sample, the EXEC function is not very simple? hehe!
/**
* Read the Clipboard contents
*/
EXEC (' Pbpaste ', $output, $return);
Var_dump ($output, $return);
/**
* Write content (go to clipboard) to the Clipboard
*/
EXEC (' echo go to clipboard pbcopy ', $output, $return);
Var_dump ($output, $return);