易截截图软件、单文件、免安装、纯绿色、仅160KB
热门标签: c c# c++ asp asp.net linux php jsp java vb Python Ruby mysql sql access Sqlite sqlserver delphi javascript Oracle ajax wap mssql html css flash flex dreamweaver xml
 最新文章 : php

php 基础笔记 boolean integer float

/***************************by
garcon1986********************************/
<?php
// boolean integer float example
$action = false;
if($action == "show version"){
echo "the version is 123".'<br>';
}else if($action == false){
echo "action is false".'<br>';
}else {
echo "action is true".'<br>';
}
//some var_dump exercise ---------- var_dump print the relational information of variables
var_dump((bool)""); //bool(false)
var_dump((bool) 1); //bool(true)
var_dump((bool) 0); //bool(false)
var_dump((bool) -1); //bool(true)
var_dump((bool) -2); //bool(true)
var_dump((bool) "foo"); //bool(true)
var_dump((bool) 2.3e5); //bool(true)
var_dump((bool) array()); //bool(false)
var_dump((bool) array(12)); //bool(true)
var_dump((bool) "false"); //bool(true)
//var_dump
$a = 3;
$b = "s1";
//$c = var_dump($a); // int(3)
$d = var_dump($a, $b);
var_dump((bool)00190); // bool(true) ......

php 基础笔记 string

/***************************by
garcon1986********************************/
<?php
// example for strings, single quoted, double quoted
echo 'display a string!<br>';
echo ' this displays
a splitted
string<br>';
echo 'i\'ll be "back"<br>';
echo 'she said:"i\'ll be back!"<br>';
echo 'the path is c:\programmes\sjg\*.*!'.'            '.'hello world<br>';
echo 'the path is c:\\prgralles\\sjg\*.*<p>';
$h = 'hellos';
$i = "hellos";
echo '$h<br>';
echo "$h"."<br>";
echo '$i<br>';
echo "$i<br>";
//heredoc example
$str = <<<EOD
Example of string
spanning multiple lines
using heredoc syntax.
EOD;
/* More complex example, with variables. */
class foo
{
var $foo;
var $bar;
function foo()
{
$this->foo = 'Foo';
$this->bar = array('Bar1', 'Bar2', 'Bar3');
}
}
$foo = new foo ......

php二级联动菜单改动版

/*********************************************************************************************
*****************************php二级联动菜单改动版***********************************
****************************************by garcon1986*****************************************
**********************************************************************************************/
2chain.php:
<mce:script language = "JavaScript"><!--

var onecount;
onecount=0;
subcat = new Array();
<?php
mysql_connect("localhost","charles","charles");
mysql_select_db( "_crm" );
$sql = "select * from site";
$result = mysql_query( $sql );
$count = 0;
while($res = mysql_fetch_row($result)){
?>
subcat[<?php echo $count ?>] = new Array("<?php echo $res[0]?>","<?php echo $res[2]?>","<?php echo $res[1]?>");
<?php
$count++;
}
echo "onecount=$count;&qu ......

PHP上传

/***************************by garcon1986**************************/
form.html
<html>
<head>
<title>Upload File</title>
</head>
<body>
<form enctype="multipart/form-data" method="POST" action="uploader.php">
<label></label>
<input type="file" name="uploadfile" />
<input type="submit" name="submit" value="submit" />
</form>
</body>
</html>
uploader.php
<?php
if($_FILES["uploadfile"]["size"] < 100000000){
if($_FILES["uploadfile"]["error"]>0){
echo "error";
}
else{
echo "success";
if(file_exists("c:/wamp/www/upload/".$_FILES["uploadfile"]["name"])){
echo "File".$_FILES["uploadfile"]["name"]."already exists";
}
else{
move_uploaded_file($_FILES["uploadfile"] ......

PHP获取radio值,并用作参数查询数据库,同一页面显示

/***************************by garcon1986************************************/
<?php
error_reporting(E_ALL ^ E_NOTICE);
//create database test
//create table php_radio(id int(10) NOT NULL AUTO_INCREMENT, name varchar(100), description varchar(1000), primary key(id));
//insert php_radio values(1, 'eat','you have eaten ...');
//insert php_radio values(2, 'drink', 'you have drank ...');
//insert php_radio values(3, 'sleep', 'you have sleep ...');
echo "<html><head></head>";
echo "<body>";
echo "<form action='use_radio.php' method='GET'>";
echo "<input type='radio' name='radio' value='eat'>Eat</input>";
echo "<input type='radio' name='radio' value='drink'>Drink</input>";
echo "<input type='radio' name='radio' value='sleep'>Sleep</input>";
echo "<input type='submit' name='search_radio' value='Button' />";
echo "</form>&quo ......

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;
} ......
总记录数:2174; 总页数:363; 每页6 条; 首页 上一页 [144] [145] [146] [147] 148 [149] [150] [151] [152] [153]  下一页 尾页
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号