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 ...
随机推荐
- jsp eclipse 创建jsp项目
选择File菜单 File->new->Other... 选择Dynamic Web Project项目->Next 写入项目->Finish 在WebContent鼠标右键- ...
- C++之路起航——标准模板库(queue)
queue: FIFO队列:先进先出队列. 优先队列:对队列中的元素按优先级的大小输出. 定义: FIFO队列: queue<数据类性>变量名. 优先队列:priority_queue&l ...
- 判断java中两个对象是否相等
java中的基本数据类型判断是否相等,直接使用"=="就行了,相等返回true,否则,返回false. 但是java中的引用类型的对象比较变态,假设有两个引用对象obj1,obj2 ...
- JSP数据交互习题错误总结
1:如果注册完页面有中文字符需要在提交后的页面显示注册信息,切记先把接受到的request的编码方式改为中文:request.setCharacterEncoding("utf-8" ...
- java 中 equals和==的区别
public static void main(String[] args) { int n=0; int m=0; System.out.println(n==m); String str = ne ...
- 我的代码观——关于ACM编程风格与librazy网友的对话
序 在拙文 <高手看了,感觉惨不忍睹——关于“[ACM]杭电ACM题一直WA求高手看看代码”>中,我对ACMer们的一些代码“惯例”发表了我的看法, librazy网友在评论中给出了他的一 ...
- Floyd算法核心代码证明
Flody 大家都知道这个最终模版: for(int k=1;k<=n;k++) for(int i=1;i<=n;i++) for(int j=1;j<=n;j++) dis[i ...
- NOIP200503采药
NOIP200503采药 [问题描述] 辰辰是个天资聪颖的孩子,他的梦想是成为世界上最伟大的医师.为此,他想拜附近最有威望的医师为师.医师为了判断他的资质, ...
- 操作系统,windows编程,网络,socket
首发:个人博客,更新&纠错&回复 之前关于c/s的一篇博文只记了思路没记代码,而且表达不清晰,事后看不知所云,这个习惯要改. 这十几天学了点关于操作系统.windows编程和网络,主要 ...
- 关于jQuery的bind()\trigger()\triggerHandler()
1.bind() 事件绑定. 多个事件会链式累加,而不会覆盖. 即 $("div").bind("click",funtion(){alert("te ...