<?php
$filename = '/data/webroot/usercode/resource/test.txt';
$content= file_get_contents($filename);
echo $content;
$fp=fopen($filename,'rb');
$contents='';
while(!feof($fp))
:
$contents .=fread($fp,5000);
endwhile;
echo $contents;
fclose($fp);
?>
$filename = '/data/webroot/usercode/resource/test.txt';
$content= file_get_contents($filename);
echo $content;
$fp=fopen($filename,'rb');
$contents='';
while(!feof($fp))
:
$contents .=fread($fp,5000);
endwhile;
echo $contents;
fclose($fp);
?>
2017-01-29
<?php
session_start();
$_SESSION['name'] = 'jobs';
$_SESSION['Sue'] = time();
//在这里删除name的session值
unset($_SESSION['name']);
session_destroy();
if(isset($_SESSION['name']))
:
echo $_SESSION['name'];
endif;
session_start();
$_SESSION['name'] = 'jobs';
$_SESSION['Sue'] = time();
//在这里删除name的session值
unset($_SESSION['name']);
session_destroy();
if(isset($_SESSION['name']))
:
echo $_SESSION['name'];
endif;
2017-01-29
<?php
session_start();
$_SESSION['name']='jobs';
echo"session_id".session_id;
echo $_SESSION['name'];
echo"<br>";
echo $_SESSION['name'];
unset ($_SESSION['name']);
echo"<br>";
var_dump($_SESSION);
?>
session_start();
$_SESSION['name']='jobs';
echo"session_id".session_id;
echo $_SESSION['name'];
echo"<br>";
echo $_SESSION['name'];
unset ($_SESSION['name']);
echo"<br>";
var_dump($_SESSION);
?>
2017-01-29
<?php
if (function_exists('mysqli_connect')) {
echo 'Mysqli扩展已经安装';
}
//Mysqli扩展已经安装
if (function_exists('mysqli_connect')) {
echo 'Mysqli扩展已经安装';
}
//Mysqli扩展已经安装
2017-01-26
echo '创建时间:'.date('Y-m-d H:i:s', filectime($filename)).'<br>';
echo '修改时间:'.date('Y-m-d H:i:s',filemtime($filename)).'<br>';
echo '最后访问时间:'.date('Y-m-d H:i:s',fileatime($filename)).'<br>';
echo '修改时间:'.date('Y-m-d H:i:s',filemtime($filename)).'<br>';
echo '最后访问时间:'.date('Y-m-d H:i:s',fileatime($filename)).'<br>';
2017-01-26
<?php
$filename = '/data/webroot/usercode/resource/test.txt';
if (file_exists($filename)) {
echo '文件存在'.'<br>';
}else{
echo '文件不存在'.'<br>';
}
if(is_readable($filename)){
echo '文件可读'.'<br>';
echo file_get_contents($filename);
}else{
echo '文件不可读';
}
?>
$filename = '/data/webroot/usercode/resource/test.txt';
if (file_exists($filename)) {
echo '文件存在'.'<br>';
}else{
echo '文件不存在'.'<br>';
}
if(is_readable($filename)){
echo '文件可读'.'<br>';
echo file_get_contents($filename);
}else{
echo '文件不可读';
}
?>
2017-01-26
unset($_SESSION) 此函数千万不可使用,它会将全局变量 $_SESSION 销毁,而且还没有可行的办法将其恢复。用户也不再可以注册 $_SESSION 变量。
2017-01-25
我写成
for({
echo '<br>数组第'.$index.'值是:'.$fruit[];
}
照样可以输出
for({
echo '<br>数组第'.$index.'值是:'.$fruit[];
}
照样可以输出
2017-01-24