php中的当前网址和根路径
当前网址是浏览器理显示的网址,是用户看到的。
根路径是php文件在服务器上的路径,是真实的文件路径。
(与java是不一样的)
如果有多层include语句,必须用根路径,否则出错。
提交表单时要提交到当前网址的相对或者绝对的网址里面。
---------------------------------------------------------------------
一个是网络调用 一个本地调用
----------------------------------------------------------------------
php 中的 根路径 是相对于磁盘物理路径而言的。
即工程所在磁盘的根目录。
如果Apache 的安装路径如下:D:/php/Apache2.2/
则引用文件时候 如果用 /mail/class.phpmailer.php
则被引用的实际路径是D:/mail/class.phpmailer.php
如果想正确引用如下文件则:
require("/php/Apache2.2/htdocs/test/mail/class.phpmailer.php")
即引用的是
D:/php/Apache2.2/htdocs/test/mail/class.phpmailer.php"
相关文档:
Php Variable Circular References
Circular-references has been a long outstanding issue with PHP. They are
caused by the fact that PHP uses a reference counted memory allocation
mechanism for its internal variables. This causes problems for longer
running scripts (such as an Applicatio ......
转载请注明出处: http://www.zvv.cn/blog/show-101-1.html
前些天发现通过Notepad++的DBGP插件结合PHP的xdebug扩展可以实现PHP文件调试,同时,介绍说包含了单步调试、监视变量还有跨 文件调试。按照网络上的资料配置好调试环境后实际试用了发现功能较为简陋,单文件调试还可,如果是跨文件调试项目就不那么舒服了, ......
// 定义一个新变量
$test = "hello";
// . 字符串连接符
echo $test.".world" // hello.world
echo "$test.world" // "" 中的变量将被解析成相应的值
&nbs ......
< ?php
require("mail/class.phpmailer.php");//调用
$mail = new PHPMailer();//实例化phpmailer
$address = "mailxi@126.com";//接收邮件的邮箱
$mail->IsSMTP(); // 设置发送邮件的协议:SMTP
......