<?php
$arr=array('apple'=>'苹果');
if( isset($arr) ) {print_r($arr);}
?>
$arr=array('apple'=>'苹果');
if( isset($arr) ) {print_r($arr);}
?>
2015-10-03
$pattern = '/\w+\s\w+\s\w+\s\w+.\w+\.\w+/';
preg_match($pattern, $subject, $matches);
print_r($matches); //结果为:Array ( [0] => def )
明明是这样啊,为什么不给过/(ㄒoㄒ)/~~
preg_match($pattern, $subject, $matches);
print_r($matches); //结果为:Array ( [0] => def )
明明是这样啊,为什么不给过/(ㄒoㄒ)/~~
2015-10-03
$sql = "insert into user(name, age, class)
values('$name', '$age', '$class')";
mysql_query($sql); //执行插入语句
$uid = mysql_insert_id();
echo mysql_insert_id();
应该是这样吧
values('$name', '$age', '$class')";
mysql_query($sql); //执行插入语句
$uid = mysql_insert_id();
echo mysql_insert_id();
应该是这样吧
2015-10-02
1.$fp = fopen('/data/webroot/usercode/code/test2.txt', 'w');
fwrite($fp, 'hello');
fwrite($fp, 'world');
fclose($fp);
2.<?php
$filename = '/data/webroot/usercode/code/test2.txt';
//写入一个字符串到$filename文件中
$data = 'i love you';
file_put_contents($filename, $data);
就是酱紫
fwrite($fp, 'hello');
fwrite($fp, 'world');
fclose($fp);
2.<?php
$filename = '/data/webroot/usercode/code/test2.txt';
//写入一个字符串到$filename文件中
$data = 'i love you';
file_put_contents($filename, $data);
就是酱紫
2015-10-02
<?php
$filename = '/data/webroot/usercode/code/resource/test.txt';
if (file_exists($filename)) {
echo file_get_contents($filename);
}
$filename = '/data/webroot/usercode/code/resource/test.txt';
if (file_exists($filename)) {
echo file_get_contents($filename);
}
2015-10-02
public function __call($name, $args) {
if ($name == 'speedDown') {
$this->speed -= 10;
}
}
好难懂啊( ˇˍˇ )
if ($name == 'speedDown') {
$this->speed -= 10;
}
}
好难懂啊( ˇˍˇ )
2015-10-02