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.
相关文档:
仿GOOGLE和Discuz分页函数(php)
这个函数只需要2个参数 当前页码和总页数,$site是路径,文件名可以按自己的需要修改
这个函数不能传递其他参数,如果要传递其他参数,在函数里自己加一个参数就行了
<?php
//计数
$sql = “SELECT count(*) from `andycms_title`;”;
$numrs = mysql_query($sql) or ......
3DES(即Triple DES)是DES向AES过渡的对称性加密算法,它使用3条64位的密钥对数据进行三次加密。是DES的一个更安全的变形。它以DES为基本模块,通过组合分组方法设计出分组加密算法。比起最初的DES,3DES更为安全。
PHP利用扩展库Mcrypt来实现DES加密,这种加密的好处主要是不同的语言平台数据可以进行交互加密传输,防止 ......
1、古老的欺骗SQL语句
在默认模式下,即使是你忘了把php.ini拷到/usr/local/lib/php.ini下,php还是打开magic_quotes_gpc=on。
这样所有从GET/POST/Cookie来的变量的单引号(')、双引号(")、反斜杠backslash(\)以及空字元NUL
(the null byte)都会被加上反斜杠,以使数据库能够正确查询。
但是在php-4-RC2的时候引入 ......
1.使用PHP的创始人 Rasmus Lerdorf 写的APC扩展模块来实现(http://pecl.php.net/package/apc)
APC实现方法:
安装APC,参照官方文档安装,可以使用PECL模块安装方法快速简捷,这里不说明
配置php.ini,设置参数 apc.rfc1867=1 ,使APC支持上传进度条功能,在APC源码说明文档里面有说明
代码范例:
复制PHP内容到剪 ......