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('G \h i').'il fait beau<p>';
// '=', '==', '===' ÈýÕßÇø±ð: '='ÊǸ³Öµ£¬ÓұߵÄÖµ¸³¸ø×ó±ß£»'=='ÊÇÖµÏàµÈ£¬ÀàÐͲ»Ò»¶¨µÈ£»'==='ÊǺãµÈ£¬ÖµÏàµÈÀàÐÍÒ²ÏàµÈ£»'!=='ÊÇÖµ²»µÈ£¬»òÀàÐͲ»µÈ¡£
$a = '34';
$b = 34;
$a == $b;
//echo (boolean)($a == $b);
var_dump((bool) $a == $b);
echo '<br>';
$a === $b;
//echo (boolean)($a === $b);
var_dump((bool) $a === $b);
echo '<br>';
var_dump((bool)($a !== $b));
echo '<p>';
//arithmetic operator
echo 5*"", '<br>'; //0
echo 5+false, '<br>'; //5
echo 5/NULL, '<br>'; //Warning: Division by zero
//assignment operator
$a = ($b = 4) + 5; // $a ÏÖÔÚ³ÉÁË 9£¬¶ø $b ³ÉÁË 4¡£
echo "$a,$b<br>";
$a = 3;
$a += 5; // sets $a to 8, as if we had said: $a = $a + 5;
$b = "Hello ";
$b .= "There!"; // sets $b to "Hello There!", just like $b = $b . "There!";
echo "$a,$b<br>";
//bitwise operator
echo 12 ^ 9; // Êä³öΪ '5'
echo '<br>';
echo "12" ^ "9"; // Êä³öÍ˸ñ×Ö·û£¨ascii 8£©
// ('1' (ascii 49)) ^ ('9' (ascii 57)) = #8
echo '<br>';
echo "hallo" ^ "hello"; // Êä³ö ascii Öµ #0 #4 #0 #0 #0
echo '<p>'; // 'a' ^ 'e' = #4
/*
--------- --------- -- ---------
result value op test
--------- --------- -- ---------
Bitwise AND
( 0 = 0000) = ( 0 = 0000) & ( 5 = 0101)
( 1 = 0001) = ( 1 = 0001) & ( 5 = 0101)
( 0 = 0000) = ( 2 = 0010) & ( 5 = 0101)
( 4 = 0100) = ( 4 = 0100) & ( 5 = 0101)
( 0 = 0000) = ( 8 = 1000) & ( 5 = 0101)
Bitwise Inclusive OR
( 5 = 0101) = ( 0 = 0000) | ( 5 = 0101)
( 5 = 0101)
Ïà¹ØÎĵµ£º
5.¹ØÓÚ±íµ¥Ë¢ÐÂ
ÎÊ£ºÎªÊ²Ã´ÎÒÔÚµã»÷ä¯ÀÀÆ÷µÄºóÍ˰´Å¥ºó£¬ËùÓÐ×ֶεÄÐÅÏ¢¶¼±»Çå¿ÕÁË£¿
´ð£ºÕâÊÇÓÉÓÚÄãÔÚÄãµÄ±íµ¥Ìá½»Ò³ÃæÖÐʹÓÃÁË session_start º¯Êý¡£¸Ãº¯Êý»áÇ¿ÖÆµ±Ç°Ò³Ãæ²»±»»º´æ¡£½â¾ö°ì·¨Îª£¬ÔÚÄãµÄ Session_start º¯Êýºó¼ÓÈë header("Cache-control: private"); ×¢ÒâÔÚ±¾ÐÐ֮ǰÄãµÄPHP³ÌÐò²»ÄÜÓÐÈκÎÊä³ö¡£
²¹³ä£º ......
ÔÚÉú²úÓ¦ÓÃÖУ¬Ä³Ì¨“Nginx+PHP+MySQL”½Ó¿ÚÊý¾Ý·þÎñÆ÷£¬°çÑݵĽÇɫʮ·ÖÖØÒª£¬Èç¹û·þÎñÆ÷Ó²¼þ»òNginx¡¢MySQL·¢Éú¹ÊÕÏ£¬¶ø¶Ìʱ¼äÄÚÎÞ·¨»Ö¸´£¬ºó¹û½«·Ç³£ÑÏÖØ¡£ÎªÁ˱ÜÃâµ¥µã¹ÊÕÏ£¬ÎÒÉè¼ÆÁË´ËÌ×·½°¸£¬±àдÁËfailover.sh½Å±¾£¬ÊµÏÖÁËË«»ú»¥±¸¡¢È«×Ô¶¯Çл»£¬¹ÊÕÏ×ªÒÆÊ±¼äÖ»Ð輸ʮÃë¡£
¡¡¡¡Ò»¡¢Ë«»ú»¥±¸¡¢È«×Ô¶¯Çл»·½ ......
ÔÎÄÁ´½Ó£ºhttp://www.phpdo.net/index.php/2010/02/11/1-14/
PHPÖлñµÃÈÕÆÚʱ¼äÐÅÏ¢µÄº¯Êý——Getdate
ʱ¼ä´Á:°üº¬ÁË´ÓunixмÍÔª£¨1970Äê1ÔÂ1 ÈÕÁãʱ£©µ½¸ø¶¨Ê±¼äµÄÃëÊý£¬ÊÇÒ»¸ö³¤ÕûÊý¡£
Getdateº¯Êý¾ÍÊÇÓÃÀ´»ñµÃµ±Ç°Ê±¼ä£¬»òÕßÓÃÀ´·ÖÎöʱ¼ä´ÁµÄ¾ßÌåÒâÒå¡£Óï·¨£º
Array getdate([int timestamp])
º¬Ò壺ti ......
¡¶Head First
Éè¼ÆÄ£Ê½¡·ÊDZ¾²»´íµÄ½²½âÉè¼ÆÄ£Ê½µÄÊ飬²»ÏñF4дµÄÄÇô¿ÝÔӦ¸ÃËãÊDZȽÏÈÝÒ×Àí½âµÄºÃÊé¡£ÊéÖеÄÀý×Ó¶¼±È½ÏdzÏÔÒ×¶®£¬²»¹ýÓÉÓÚÊÇÍâ¹úÀÐдµÄ£¬ËùÒÔÀý×Ó
µÄϰ¹ß²»ÊǺܸ½ºÏÖйúÌØÉ«£¬¿ÉÄÜż¶û¿´ÆðÀ´ÓÐЩ±ðŤ£¬»¹ÓÐÓïÑÔϰ¹ßÒ²²»ÊÇÖйú·ç¡£µ±È»¿´¹ýÕâ±¾ÊéÖ®ºó£¬Äã²ÅÄÜÉî¿ÌÀí½âÉè¼ÆÄ£Ê½µ½µ×ÄÜΪÄã½â¾öÄÄЩ
퉣 ......
Nginx + PHP + Mysql (php-frm 방식)
글쓴이 :
최고관리자
조회 : 2,884
......