php使用 set_include_path
通过set_include_path引用home/lib/image.func.php
1.创建include.php
2.添加如下代码
3.在需要引用的文件中包含include.php文件
<?php
session_start();
define("ROOT", dirname(__FILE__));
set_include_path(".".PATH_SEPARATOR.ROOT."/lib".PATH_SEPARATOR.ROOT."/core".PATH_SEPARATOR.get_include_path());
require_once'mysql.func.php';
require_once'image.func.php';
require_once'common.func.php';
require_once'image.func.php';
?>

包含inclde.php 文件后无法正常运行
原因是因为两次使用了session_start();

php使用 set_include_path的更多相关文章
- set_include_path详细解释
zendframework的示例index.php里有这样一句 set_include_path('.' . PATH_SEPARATOR . '../library/'. PATH_SEPARATO ...
- set_include_path — 设置 include_path 配置选项为当前脚本设置 include_path 运行时的配置选项。
说明 string set_include_path ( string $new_include_path ) 为当前脚本设置 include_path 运行时的配置选项. 参数 new_includ ...
- php set_include_path
string set_include_path ( string $new_include_path ) 为当前脚本设置 include_path 运行时的配置选项. Example #2 添加到in ...
- set_include_path()的用法
朋友们 开发的时候 ,总会 遇到 include_once()的情况.有时候,我们需要大量的引用文件,但是被引用文件的路径有时候是个问题. 我们可以把 经常要引用 的文件,放在一个 文件夹中,我们取 ...
- php 文件路径设置 set_include_path(); get_include_path();
<?php set_include_path($string); //设置路径 get_include_path(); // 获取当前的路径 //例如:文件路径为: //D:/phpweb/de ...
- set_include_path和get_include_path用法详解
首先set_include_path这个函数呢,是在脚本里动态地对PHP.ini中include_path进行修改的.而这个include_path呢,它可以针对下面的include和require的 ...
- 012PHP文件处理——copy rename file set_include_path
<?php //copy rename file set_include_path /*file() 以行为单位返回数组 * */ /*$arr=file('b.txt'); foreach ( ...
- 【php】set_include_path和get_include_path用法详解
目的:在框架中方便加载文件 参考:http://blog.sina.com.cn/s/blog_4ce89f200100twbl.html 如果我们没有设置这个值,可能我们需要写一些完全的路径: ...
- Php函数set_include_path()函数详解
set_include_path--设置include_path配置选项. 说明 string set_include_path(string $new_include_path); 为当前脚本设置i ...
随机推荐
- __int64和long long输入输出
__int64 num; scanf("%I64d", &num); printf("%I64d\n", num); long long num; sc ...
- java中Date的getTime() 方法奇葩问题
今天遇到了一个奇葩问题: 从数据库中读取了3个Date类型的数据: DATE1:2015-03-12 12:10:42 DATE2:2015-03-12 12:04:40 DATE3:2015-03- ...
- 动画--过渡属性 transition-property
早期在Web中要实现动画效果,都是依赖于JavaScript或Flash来完成.但在CSS3中新增加了一个新的模块transition,它可以通过一些简单的CSS事件来触发元素的外观变化,让效果显得更 ...
- css3文字与字体
---恢复内容开始--- 1.text-overflow(用来设置是否使用省略标记)必须和white-space:nowrap 同时使用white-space:nowrap(强制文本在一行显示) wo ...
- Calculation控制台
接口 using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace s ...
- sql 去除列中内容的单引号
update [dbo].[历史数据补全$] set bankCardNo=replace(bankCardNo,'''','') 总共4个单引号,外边2个是字符串固有的2个,里边两个就表示是一 ...
- oracle的簇的管理
使用ALTER修改簇属性(必须拥有ALTER ANY CLUSTER的权限) 1.修改簇属性 可以修改的簇属性包括: * PCTFREE.PCTUSED.INITRANS.MAXTRANS.STORA ...
- clock gate cell
clock gate的cell多采用latch的形式,来实现,尽可能避免glitch的产生. 可以的verilog建模方式: module cell_ckgate(TE,E,CP,Q) input ...
- 绑定repeater时三目运算加特殊结果处理
<%#((Convert.ToDouble().ToString() != ).ToString(%
- UISlider控件属性及方法(转)
初始化一个Slider UISlider *slider = [[UISlider alloc]initWithFrame:CGRectMake(0, 400,320 , 20)]; 访问UI ...