PHP Base

print

print_r

$_var

$var_1


$_var = 1;

print "this is $_var";

print "i say \"hehe\"!";

print " hehe \" haha \" $_var '$_var' ";

?>


Name:

《a.php》 

$title = $_POST['title'];

print "

$title";
?>



http://*.*.*.*/a.php?name=1

$var_name = $_GET['name'];

print "$var_name";
?>


$a = "a";

$b = "b";

$c =$a . $b;

$c = "$a$b";

?>


$posting = nl2br($_POST['posting']);

print "

$posting

";

nl2br()

?>


htmlspecialchars()

htmlentities()

strip_tags()

$html_post = htmlentities($_POST['posting']);

$strip_post = strip_tags($_POST['posting']);

print "

$posting

$html_post

$strip_post

"

?>


$urlencode()

$name = urlencode($name);

$email = urlencode($_POST['email']);

print "";

?>


crypt()

mcrypt_encrypt() mcrypt_decrypt()

strtok()strcmp()strnatcmp()strcasecmp()strnatcasecmp()strstr()strpos()

str_word_count()substr()

str_ireplace()ucfirst()ucwords()strtoupper()strtolower()


if ($OK) {

} elseif($OTHER) {

}else {

}

switch ($var) {

case "$val1":

break;

default:

break;

}

for ($i = 1; $i <=31; $i++) {

}

while ($OK) {

}

do {

} while ($OK);

?>


empty()isset()is_numeric()


$list = array('1','2');

$list2 = array (

1 => 'a', 

2 => 'b'

);

$list2[1] = 'z';

unset($list2[1]);

$listlist = array (

'list' => $list,

'list2' => $list2

);

sort($list);

rsort($list2);

?>

你可能感兴趣的:(PHP)