所以说,路径为毛又多个/code/。。o(╯□╰)o
真正路径:/data/webroot/usercode/resource/test.txt
真正路径:/data/webroot/usercode/resource/test.txt
2014-12-08
<?php
$filename = '/data/webroot/usercode/resource/test.txt';
if (is_writeable($filename)) {
echo 'writeable<br>';
file_put_contents($filename, 'test');
}
if (is_readable($filename)) {
echo 'readable<br>';
}
$filename = '/data/webroot/usercode/resource/test.txt';
if (is_writeable($filename)) {
echo 'writeable<br>';
file_put_contents($filename, 'test');
}
if (is_readable($filename)) {
echo 'readable<br>';
}
2014-12-08
class Truck extends Car{
public function getSpeed(){
return $this->speed+=50;
}
}
$car = new Truck();
$car->speedUp();
//echo $car->speed."\n";
$car->getSpeed();
echo $car->speed."\n";
public function getSpeed(){
return $this->speed+=50;
}
}
$car = new Truck();
$car->speedUp();
//echo $car->speed."\n";
$car->getSpeed();
echo $car->speed."\n";
2014-12-08
class Truck extends Car{
public function getSpeed(){
$this->speed +=50;
return $this->speed;
}
}
$car = new Truck();
$car->speedUp();
echo $car->getSpeed();
public function getSpeed(){
$this->speed +=50;
return $this->speed;
}
}
$car = new Truck();
$car->speedUp();
echo $car->getSpeed();
2014-12-08
class Truck extends Car{
public function getSpeed(){
return $this->speed;
}
public function speedUp(){
$this->speed +=50;
}
}
差在哪里?
public function getSpeed(){
return $this->speed;
}
public function speedUp(){
$this->speed +=50;
}
}
差在哪里?
2014-12-08
最赞回答 / sophia_yu
1、echo 输出一个或多个字符串。echo不是一个函数,它是一个语言结构,没有返回值,不能被调用2、print_r 是一个函数,打印关于变量的信息,语法格式如下:bool print_r ( mixed $expression [, bool $return ] )如果是 string 、 integer 或 float类型 ,将打印变量值本身;如果是 array ,将会按照一定格式显示键和元素, object 与数组类似。详细的使用方法,建议下载一下php的学习手册,里面有很详细的资料。
2014-12-07