PHPÊý¾ÝÀàÐÍ
PHPÊý¾ÝÀàÐÍ£¬ÓаËÖÖÔʼÀàÐÍ
ËÄÖÖ±êÁ¿ÀàÐÍ
²¼¶ûÐÍ£¨boolean£©
ÕûÐΣ¨integer£©
¸¡µãÐÍ£¨fload¡¢Ò²×ödouble£©
×Ö·û´®£¨string£©
Á½ÖÖ¸´ºÏÀàÐÍ
Êý×飨array£©
¶ÔÏó£¨object£©
Á½ÖÖÌØÊâÀàÐÍ
×ÊÔ´£¨resource£©
NULL
PHPÊÇÒ»ÖÖÈõÀàÐÍÓïÑÔ£¬ÔÚ´ó¶àÊý±à³ÌÓïÑÔÖУ¬±äÁ¿Ö»Äܱ£³ÖÒ»ÖÖÀàÐ͵ÄÊý¾Ý£¬¶øÇÒÕâ¸öÀàÐͱØÐëÔÚʹÓñäÁ¿Ç°ÉùÃ÷£¬ÀýÈçCÓïÑÔ¡¢JavaÓïÑÔÖУ¬¶¼ÐèÒªÔÚÉùÃ÷±äÁ¿Ê±Ö¸¶¨Êý¾ÝÀàÐÍ¡£È»¶ø£¬PHP±äÁ¿µÄÊý¾ÝÀàÐͲ»ÐèÒª½øÐÐÉùÃ÷£¬PHP±äÁ¿µÄÊý¾ÝÀàÐÍÊǸù¾Ý¸Ã±äÁ¿Ê¹ÓõÄÉÏÏÂÎÄÔÚÔËÐÐʱ£¨¼´±äÁ¿µÄÖµ£©¾ö¶¨µÄ¡£
Îı¾²é¿´¸´ÖÆ´úÂë´òÓ¡¹ØÓÚ
<?php
$bool = true; // ²¼¶ûÐÍ
$str = "foo"; // ×Ö·û´®
$int = 12; // ÕûÐÍ
//»ñÈ¡Êý¾ÝÀàÐÍ
echo gettype($bool); // Êä³ö boolean
echo gettype($str); // Êä³ö string
echo gettype($int); // Êä³ö integer
$var=12;
echo $var; //Êä³ö 12
$var="hello";
echo $var; //Êä³ö hello
?>
<?php
$bool = true; // ²¼¶ûÐÍ
$str = "foo"; // ×Ö·û´®
$int = 12; // ÕûÐÍ
//»ñÈ¡Êý¾ÝÀàÐÍ
echo gettype($bool); // Êä³ö boolean
echo gettype($str); // Êä³ö string
echo gettype($int); // Êä³ö integer
$var=12;
echo $var; //Êä³ö 12
$var="hello";
echo $var; //Êä³ö hello
?>
1¡¢ÕûÐÎ
ÕûÐÍÖµ¿ÉÒÔÓÃÊ®½øÖÆ¡¢°Ë½øÖÆ¡¢Ê®Áù½øÖÆÖ¸¶¨£¬Ç°Ãæ¿ÉÒÔÑ¡Ôñ¼ÓÉÏÕý¸ºµÄ·ûºÅ£¨+»ò-£©
Îı¾²é¿´¸´ÖÆ´úÂë´òÓ¡¹ØÓÚ
<?php
$num_int = 1234; // Ê®½øÖÆÊý
$num_int = -123; // Ò»¸ö¸ºÊý
$num_int = 0123;
Ïà¹ØÎĵµ£º
#apt-get install apache2
//°²×°apahce2
#apt-get install php5
//°²×°php5
#apt-get install mysql-server
//°²×°mysql·þÎñ¶Ë
#apt-get install mysql-myclient
//°²×°mysqlµÄ¿Í»§¶Ë
#apt-get install php-mysql
//°²×°php-mysqlµÄÁ¬½á
apache+php+mysql »·¾³ÒѾ´î½¨ºÃÁË
½«ÒÔϵķþÎñÖØÆôÒ»ÏÂ
#/et ......
PHP5.0ºó£¬phpÃæÏò¶ÔÏóÌá³É¸ü¶à·½·¨£¬Ê¹µÃphp¸ü¼ÓµÄÇ¿´ó£¡£¡
һЩÔÚPHP½ÐħÊõ·½·¨µÄº¯Êý£¬ÔÚÕâÀï½éÉÜһϣºÆäʵÔÚÒ»°ãµÄÓ¦ÓÃÖУ¬ÎÒÃǶ¼ÐèÒªÓõ½ËûÃÇ£¡£¡
1.__construct() µ±ÊµÀý»¯Ò»¸ö¶ÔÏóµÄʱºò£¬Õâ¸ö¶ÔÏóµÄÕâ¸ö·½·¨Ê×Ïȱ»µ÷Óá£
Java´úÂë
class Test { function __construct() { ec ......
ËäÈ»PHPÌṩÁ˺ܶ๦ÄÜÎÒÃÇ£¬µ«ÓÐЩÊÂÇ黹ûÓд¦ÀíÕâЩ·Ç³£·½±ã¡£ÀýÈ磬PHPÌṩµÄÈÕÆÚ¹¦ÄÜ£¬Ê±¼äºÜÓÐÏÞ¡£ MySQLÒѾÌṩÁËÐí¶àÎÒÃÇÕâЩ¹¦ÄÜ¡£ÎÒ¿ÉÒÔʹÓÃMySQLº¯ÊýÀ´´¦ÀíPHPµÄ¹ý³Ì£¿ÎÒÔÚÏÂÃæµÄ³¢ÊÔ¡£
“£¿ PHPµÄ
$ data_time =“1998-12-31 23:59:59”;
$ connect_id = mysql_connect£¨'±¾µØÖ÷»ú'£©;
......
PHP±í´ïʽ
±í´ïʽÊdz£Á¿¡¢±äÁ¿ºÍÔËËã·ûµÄ×éºÏ
±í´ïʽÊÇPHPÖеÄÖØÒªÄÚÈÝ£¬PHPÖм¸ºõËùÓеĶ«Î÷¶¼¿ÉÒÔ³ÆÎª±í´ïʽ
$x=10;
$y=($x=10);
$y+=($x=10);
$z=&$x;
$condition?$true_item:$false_item;
PHPÔËËã·û
ÔËËã·ûÊÇÓÃÀ´¶ÔÊýÖµ»ò±äÁ¿½øÐÐijÖÖ²Ù×÷ÔËËãµÄ·ûºÅ¡£Ò»°ãµØËµ£¬ÔËËã·û¿ÉÒÔ´øÓÐ1¸ö¡¢2¸ö»òÕ߸ü¶à¸öÔËË ......