Is copy possible in PHP?

Can I copy a variable in PHP?

I like to copy a variable in PHP in order to paste the variable with my mouse or ctr+c

The code below does NOT work correctly, but I hope it shows what I want.

[b]would-be code[/b]

<?php
$foo = "myText";

function copy_foo($foo)
{
copyTheVariable_foo
}

copy_foo($foo);

?>

if users open the page which has some code for copying like the above, the users can paste “myText” with their mouses or ctr+c.
Can I do it in PHP with your help?

It sounds like you want the user to click and see this happen immediately. You forget that PHP runs on the server, so in order for that to happen, the page would have to be refresehed.

I think perhaps you want to write some javascript instead.

If what your looking for, is to put something on the users clipboard after an event, then you will need a combination of javascript and flash to do this correctly across most browsers. PHP wont allow you access to the users clipboard.