php Êä³ö¶þ½øÖÆÊý¾ÝÁ÷? - PHP / »ù´¡±à³Ì
½«ÒªÊä³öµÄ¶þ½øÖÆÊý¾ÝдÈëÎļþÖУ¬·½±ã²é¿´¡£
дÈëÎļþ
PHP code:
$number = 123;
$handle = fopen ("data.dat", "w");
fwrite ($handle, pack ("L", $number));
fclose($handle);
¶ÁÈ¡Êý¾Ý
PHP code:
$handle = fopen ("data.dat", "rb");
$data = fread ($handle, 4);
$array = unpack ("L*", $data);
print_r($array);
Èç¹ûÎÒдÈëµÄÊÇ×Ö·û´®£¬$number="ÖйúÈË"
fwrite ($handle, pack ("L", $number));//pack ÖдæÈ¡·½Ê½¸ÄΪ C/c ¶¼ÎÞ·¨ÕýÈ·µÄ¶ÁÈ¡³öÀ´£¿
Èç¹ûÎÒÒªÊä³öµÄÊý¾ÝÁ÷ÊÇÒ»¸öÊý×éÔõô°ì£¿È磺array("par1"=>array("sex","age"),"par2"=>array("ss","ºÇºÇ"))
ÔõÑùÕýÈ·µÄÊä³öΪ¶þ½øÖÆÊý¾Ý
лл£¡
PHP code:
//var_export
$arr = array ('a', 'b', array ("c", "d", "e"));
echo var_export ($arr);
/* £º
array (
0 => 'a',
1 => 'b',
2 =>
array (
0 => 'c',
1 => 'd',
2 => 'e',
),
)
*/
PHP code
Code highlighting produced by
Ïà¹ØÎÊ´ð£º
Ôڲɼ¯Ò»¸öÒ³ÃæµÄʱºòͨ³£¶¼ÊÇʹÓÃfile_get_contents($url)
²»¹ý·µ»ØµÄ½á¹ûÓÐʱºò»á²»È«
Èç¹ûÔÚhtmlÖÐʹÓà document.ready,ÔÚÒ³Ãæ×¼±¸ºÃºó£¬Ê¹ÓÃajax¶ÁÈ¡±ðÒ»²¿·ÖµÄÊý¾Ý
ÔÙͨ¹ýÐÞ¸Ähtml±êÇ©µÄÄÚÈÝ£¬¾Í²¿·ÖµÄÊý¾Ý¾ ......
PHPÖÐ ÉùÃ÷±äÁ¿µÄʱºòÒ»¸ö$¸úÁ½¸ö$µÄÇø±ð
±ÈÈç˵
$var="333"; ±íʾ±äÁ¿ÃûΪ$varµÄ±äÁ¿µÄֵΪ333
$var="myvar";$$var="333";±íʾ±äÁ¿ÃûΪ$myvarµÄ±äÁ¿µÄֵΪ333
ÕâÑù˵Çå³þÁËÂð£¿
......
Çë½Ì¸ßÊÖ°ïæ£¬session_start£¨£©·ÅÔÚÍⲿµÄÎļþÓà require »ò include °üº¬½øÀ´£¬ÇëÎÊÕâÑù×öºÏÀíÂ𣿣¿´úÂëÔËÐÐÊÇÕý³£µÄ£¬ÕâÑù×öºÏÀíÂ𣿣¿Çë¸ßÊÖÖ¸µã¡£¡£¡£¡£ лл····
require »ò include ......
¼±Çó£ºÔÚphp½Å±¾ÀïÔõôµ÷ÓÃjsÎļþÀï·½·¨£¿
»òÕßÔÚjsÎļþÀïµ÷ÓÃphpÎļþдµÄseesion£¿
PHP¸ÕÈëÃÅѧϰ,ÓÑÇé¶¥Ò»¸ö
¼±Çó£ºÔÚphp½Å±¾ÀïÔõôµ÷ÓÃjsÎļþÀï·½·¨£¿
//echo '<script>alert("ok");< ......
phpÖÐÈçºÎÊä³öǧ·Öλ·Ö¸ô·û¡£¡£¡£¡£¡£
number_format
PHP code:
//ÊÇÕâÖÖЧ¹û°É£¿
echo number_format(123123123, 2, '.', ',');
//½á¹ûÊä³ö123,123,123.00 2ÊÇСÊýµãºóλÊý£¬µÚÈý¸ö²ÎÊýÊÇСÊýµã·Ö¸ô·û ......