PHP无限梯归
<?php
class Tree
{
// public $data=array();//所有节点值
// public $cateArray=array();//所有父节点
function Tree()
{
}
//setNode(目录ID,上级ID,目录名字);
function setNode ($id, $parent, $value){
$parent = $parent?$parent:0;
$this->data[$id] = $value;//获取当前ID对应的当前目录名
$this->cateArray[$id] = $parent;//获取当前ID对应的父分类ID
//echo $id."->".$this->cateArray[$id]."--".$this->data[$id]."<br>";
}
function getChilds($id=0)
{
$childArray=array();
$childs=$this->getChild($id);
foreach ($childs as $child)
{
$childArray[]=$child;
$childArray=array_merge($childArray,$this->getChilds($child));//id 递归 累加
}
return $childArray;
}
function getChild($id)
{
&nbs
相关文档:
<?php
/*
* -------------------------------------------------
* Author : Fanglor
* Email : Fanlor@163.com
* Url : www.skyleft.com
* Date : 2009-10-13
* -------------------------------------------------
*/
function arr_foreach ($arr) {
if (!is_array ($arr)) {
return fa ......
一. 首先做一个简单的so文件:
/**
* hello.c
* To compile, use following commands:
* gcc -O -c -fPIC -o hello.o hello.c
* gcc -shared ......
Apache Httpd PHP环境搭建
1、安装Apache服务器
2、修改httpd.conf 中 ServerName localhost:9080 和Listen 9080
3、安装PHP5,类型选择Apache2.*,选择Apache配置文件目录。
4、修改httpd.conf中PHP5增加的配置为如果内容:
#BEGIN PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL
& ......
PHP 支持curl函数(允许你用不同的协议连接和沟通不同的服务器). curl
是使用URL语法的传送文件工具,支持FTP、FTPS、HTTP HTPPS SCP SFTP TFTP TELNET DICT
FILE和LDAP。curl 支持SSL证书、HTTP POST、HTTP PUT 、FTP
上传,kerberos、基于HTT格式的上传、代理、cookie、用户+口令证明、文件传送恢复、http代理 ......
原文参考http://www.cnblogs.com/xxcainiao/archive/2009/04/18/1438482.html
稍作修改,做了一个goto按钮:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xh ......