Provide copying and pasting to the Clipboard for PHP.
PHP port of atotto/clipboard except for the Windows part
- OSX
- Linux, Unix/BSD: Requires
xclip
orxsel
to be installed -
- Wayland: Requires wl-clipboard
- Android using Termux: Requires Termux:API add-on
- Windows: Copying works normally but pasting requires paste.exe to be in PATH or it'll fallback to using powershell which a bit slow.
composer require asvvvad/clipboard:dev-master
require 'vendor/autoload.php';
$c = new Clipboard();
if ($c->isUnsupported() === false) {
$c->writeAll('copied');
echo $c->readAll(); // "copied"
}
My own cply-php