易截截图软件、单文件、免安装、纯绿色、仅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.


相关文档:

Apache2.2 php5.2 mysql 配置方法【简】

Apache
PHP
MySQL

按照通常的方法(可以在网上很容易搜索到)全部安装完成后,
1,修正httpd.conf
可按照网络上可搜索到的apache安装教程修改具体内容。这一步主要是配置apache本身的参数。
2,加入支持php5和mysql的代码到httpd.conf
LoadFile G:/server/php5/libmysql.dll
LoadModule php5_module G:/serve ......

php 购物车实例

php 购物车实例
 <?php
/**
php 购物车实例
网上搜到的,简单容易理解。cookie存购物车ID,db存购物车数据。 购物车session的产生代码
*/
if(! $session && ! $scid) {
/*
session用来区别每一个购物车,相当于每个车的身份证号;
scid只用来标识一个购物车id号,可以看做是每个车的名字;
......

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 ......

PHP5面向对象:Object Cloning

PHP4:
<?
$sample1 = new StdClass();
$sample1->name = "Hasin";
$sample2 = $sample1;
$sample2->name = "Afif";
echo $sample1->name;
?>
In PHP4 it works differently; it will output Hasin, as both are different from 
each other.
PHP5:
<?
$sample1 = new StdClass();
$ ......

PHP程序61条面向对象分析设计的经验原则 (转)

 
你不必严格遵守这些原则,违背它们也不会被处以宗教刑罚。但你应当把这些原则看成警铃,若违背了其中的一条,那么警铃就会响起 。 ----- Arthur J.Riel
 
(1)所有数据都应该隐藏在所在的类的内部。
 
(2)类的使用者必须依赖类的共有接口,但类不能依赖它的使用者。
 
(3)尽量减少类的协议中的 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号