易截截图软件、单文件、免安装、纯绿色、仅160KB

PHP多维数组

/***************************by
garcon1986********************************/
一个三维数组的显示,保存以备以后使用。
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<?php
error_reporting(E_ALL ^ E_NOTICE);
$conn = mysql_connect("localhost","charles","charles");
mysql_select_db("crm1204", $conn);
//为了更好的显示for better display
function dump($vars, $label = null, $return = false) {
if (ini_get('html_errors')) {
$content = "<pre>\n";
if ($label !== null && $label !== '') {
$content .= "<b>{$label} :</b>\n";
}
$content .= htmlspecialchars(print_r($vars, true));
$content .= "\n</pre>\n";
}
else {
$content = "\n";
if ($label !== null && $label !== '') {
$content .= $label . " :\n";
}
$content .= print_r($vars, true) . "\n";
}
if ($return) {
return $content;
}
echo $content;
return null;
}
/* 不好的例子
$query = "select * from entreprise";
$result = mysql_query($query);
while($row = mysql_fetch_assoc($result)){
$query2 = "select * from site where entreprise_id = $row[entreprise_id]";
$result2 = mysql_query($query2);
$a2 = array();
while($row2 = mysql_fetch_assoc($result2)){
$query3 = "select * from salarie where site_id = $row2[site_id]";
$result3 = mysql_query($query3);
while($row3 = mysql_fetch_assoc($result3)){
$a3[] = array("text"=>$row3[nom]);
}
if($a3[site_id] == $a2[site_id]){
$a2[] = array("text"=>$row2[nom],'children'=>$a3);
}
}
if($a2[entreprise_id] == $a1[entreprise_id]){
$a1[] = array("text"=>$row[id]." ".$row[nom],'children'=>$a2);
}
}
//print_r($a1);
//echo json_encode($a1);
dump($a1);
*/
$entreprise_q = mysql_query("select * from entreprise");
$site_q = mysql_query("select * from site");
$salarie_q = mysql_query(&quo


相关文档:

一些被忽视的 PHP 函数

转载自:http://www.gracecode.com/archives/3013/
作者:手气不错
真的是不用不知道,其实我们熟悉的 PHP 还有很多好东西没有发掘。看到这篇文章
,当时就泪奔了好几回,重点推荐下,顺便我自己也做个整理。
sys_getloadavg()
这个函数
返回当前系统的负载均值信息
(当然 Windows 下不适用),详细文档可以翻阅 PH ......

php 基础笔记 logic statements

/***************************by
garcon1986********************************/
<?php
//if 语句
$a = $b = 3;
if($a = $b)
print "a is equal to b<br>";
//else 语句
if($a < $b){
print "a is smaller than b";
} else {
print "a is not smaller than b<br> ......

php 基础笔记 operators

/***************************by
garcon1986********************************/
<?php
//php avancé 5 example
$a = 'hello';
$a .= 'world';
$table = 'users';
$id = 5;
$sql = 'SELECT * from'.$table. "WHERE ID = '$id'";
//date() G显示24小时的格式,i显示分钟
echo 'il est'.date( ......

php 基础笔记 array

/***************************by
garcon1986********************************/
<?php
// simple assgin the values
$arr1 = array(12 => 10, 'sjg' => 'yaya');
echo $arr1[12].'<br>'; // 10
echo $arr1['sjg']."<br>"; //yaya
echo "wo ai ni !<p> ......

PHP上传

/***************************by garcon1986**************************/
form.html
<html>
<head>
<title>Upload File</title>
</head>
<body>
<form enctype="multipart/form-data" method="POST" action="uploader.php">
<label> ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号