易截截图软件、单文件、免安装、纯绿色、仅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的ip2long有bug,慎用

先看看下边这段PHP代码。这段使用ip2long函数,对同一个IP进行转换。当然,也有人认为58.99.011.1和058.99.011.1算不上合法的
IP,那就Return,此文对你没有帮助。
为什么要使用带前导零的ip:为了在数据库中查询,这个可以在IP库中定位到ip所对应的位置信息。虽然没有整型的IP查询效率高,但毕竟直观啊。
<?php
ech ......

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();
$ ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号