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.
相关文档:
3DES(即Triple DES)是DES向AES过渡的对称性加密算法,它使用3条64位的密钥对数据进行三次加密。是DES的一个更安全的变形。它以DES为基本模块,通过组合分组方法设计出分组加密算法。比起最初的DES,3DES更为安全。
PHP利用扩展库Mcrypt来实现DES加密,这种加密的好处主要是不同的语言平台数据可以进行交互加密传输,防止 ......
之前一直都是在服务器调试程序,有一天想弄到本地来,可死活就是连不上远程服务器了。
本地:windows+apache。
远程服务器:windows+ms sql 2008.
php和apache该配置的都配了,其他程序也可以运行,可就是连不上数据库。
苦苦寻觅 ......
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的时候引入 ......
php 购物车实例
<?php
/**
php 购物车实例
网上搜到的,简单容易理解。cookie存购物车ID,db存购物车数据。 购物车session的产生代码
*/
if(! $session && ! $scid) {
/*
session用来区别每一个购物车,相当于每个车的身份证号;
scid只用来标识一个购物车id号,可以看做是每个车的名字;
......
你不必严格遵守这些原则,违背它们也不会被处以宗教刑罚。但你应当把这些原则看成警铃,若违背了其中的一条,那么警铃就会响起 。 ----- Arthur J.Riel
(1)所有数据都应该隐藏在所在的类的内部。
(2)类的使用者必须依赖类的共有接口,但类不能依赖它的使用者。
(3)尽量减少类的协议中的 ......