易截截图软件、单文件、免安装、纯绿色、仅160KB

Dompdf for PHP & Replace Url to link

If you want to put some big table in the pdf file, you may got the layout messy. One way to solve the problem is to change the paper size.  In "includes/cpdf_adapter.cls.php", Change the size you used in the array to whatever you want.
One tip: Replace Url into Clickable link.
$text = ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]", "<a href="\" mce_href="\""\\0\" rel=\"nofollow\">\\0</a>", $text);
It may look like gibberish at first, but if you look at it for awhile, you might be able to guess what it does.
Suppose you’re writing a PHP script that displays data, let’s use
blog comments as an example. Sometimes the data being displayed may
have a URL pasted into it by the user that submitted it. Wouldn’t it be
nicer for the end user if URLs like that were automatically turned into
clickable links, so “http://google.com” would become “http://google.com
?”
That’s exactly what this line of PHP code does. It takes the variable $text
and parses through it, converting stray URLs into clickable links.


相关文档:

PHP正则表达式应用技巧

PHP正则表达式主要用于字符串的模式分割、匹配、查找及替换操作。使用正则表达式在某些简单的环境下可能效率不高,因此如何更好的使用PHP正则表达式需要综合考虑。
我的PHP正则入门,是起源于网上的一篇文章,这篇文章由浅入深的阐述了PHP正则表达式使用的方法,我觉得是一个很好的入门材料,不过学成还是要靠个人,在使用 ......

在PHP中通过系统信号量加锁方式获取递增序列ID

 前一阵子,设计LAJP时需要在PHP中生成唯一ID,看似小菜一碟却着实让我为难了,在Java中一个同步方法即可搞定的事,但在PHP中却没有好的解决思路。
在网上搜了搜,有两个办法但都不太好:一个是简单的以进程ID+时间戳,或进程ID+随机数来产生近似的唯一ID,虽简单但对于追求“完美”的我不愿这样凑合,再说 ......

Apache+MySQL+PHP环境配置

版本:apache_2.2.6-win32-x86-no_ssl
直接按默认安装,安装时要关闭浏览器跟下载软件,否则安装完成后服务器不能启动,报不能绑定80端口的错误。启动后在地址栏中输入“http://localcast/”或“http://127.0.0.1/”,如果可以看到"It Works",说明安装成功。
如果需要更改默认路径,打开“C:\P ......

本地PHP连接远程服务器

    之前一直都是在服务器调试程序,有一天想弄到本地来,可死活就是连不上远程服务器了。
    本地:windows+apache。
    远程服务器:windows+ms sql 2008.
   php和apache该配置的都配了,其他程序也可以运行,可就是连不上数据库。
   苦苦寻觅 ......

PHP日常开发小技巧

PHP批量取得checkbox的值
1、命名
<input type='checkbox' name='checkbox[]' value=$dwmyrow[banzhu] />
2、使用
当计划当作sql指令的一部分时:如果参与控制的字段是数值型的,则
if(! empty($_POST['checkbox'])) {
$expr = join(",", $_POST['checkbox']);
$sql = "select * from tbl_name where field in ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号