复制到剪贴板在PHP中 [英] copy to clip board in php

查看:124
本文介绍了复制到剪贴板在PHP中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个网站,其中我需要复制到剪贴板功能。在一个网站中,有一些代码。如果用户点击该代码。代码将复制并可以粘贴到任何地方。





假设ABCED是我的代码,如果点击ABCED然后这段代码将被复制....

我需要一个代码或示例,通过该代码或示例运行所有类型的浏览器特别是Mozilla或chrome

解决方案

无法在php中执行,因为php是服务器端

只有IE允许在客户端执行它

a很好的解决方案是自动选择[突出显示]代码一旦你点击它的容器

然后要求用户复制它



这个实现我在许多提供代码托管的网站上看到过

I create a site in which i need a copy to clipboard functionality.In a site ther is some code. if a user click on that code .the code will copy and can paste anywhere.


Suppose ABCED is my code and if click on ABCED then this code will copy....
I need a code or example through which run on all type of browser specially Mozilla or chrome

解决方案

cannot do it in php since php is server side
only IE allows to do it even in client side
a good solution would be to auto select [highlight] the code once you click on its container
and then ask user to copy it

This implementation I've seen in many sites offering code hosting


这篇关于复制到剪贴板在PHP中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆