PHP Operation MACOS Shearing Board

Source: Internet
Author: User
Tags header

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);



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.