ntry'=﹥'russia',
office=﹥array(google,oracle));
echo json_encode($json_data);
9、处理MySQL时间戳
$query = select UNIX_TIMESTAMP(date_field) as mydate
from mytable where 1=1;
$records =
mysql_query($query) or die(my
sql_error());
while($row = mysql_fetch_array($records))
{
echo $row;
}
10、解
压缩Zip文件
﹤php
function unzip($location,$newLocation){
if(exec(unzip $location,$arr)){
mkdir($newLocation);
for($i = 1;$i﹤ count($arr);$i++){
$file = trim(preg_replace(~inflating ~,,$arr[$i]));
copy($location.''.$file,$newLocation.''.$file);
unlink($location.''.$file);
}
return TRUE;
}else{
return FALSE;
}
}
﹥
Use the code as following
﹤php
include 'functions.php';
if(unzip('zipedfilestest.zip','unzipedmyNewZip'))
echo 'Success!';
else
echo 'Error';
﹥