PHPÊý¾ÝÀàÐÍת»»
PHPÊý¾ÝÀàÐÍת»»
PHPµÄÊý¾ÝÀàÐÍת»»ÊôÓÚÇ¿ÖÆת»»£¬ÔÊÐíת»»µÄPHPÊý¾ÝÀàÐÍÓУº
£¨int£©¡¢£¨integer£©£º×ª»»³ÉÕûÐÎ
£¨float£©¡¢£¨double£©¡¢£¨real£©£º×ª»»³É¸¡µãÐÍ
£¨string£©£º×ª»»³É×Ö·û´®
£¨bool£©¡¢£¨boolean£©£º×ª»»³É²¼¶ûÀàÐÍ
£¨array£©£º×ª»»³ÉÊý×é
£¨object£©£º×ª»»³É¶ÔÏó
PHPÊý¾ÝÀàÐÍÓÐÈýÖÖת»»·½Ê½£º
ÔÚҪת»»µÄ±äÁ¿Ö®Ç°¼ÓÉÏÓÃÀ¨ºÅÀ¨ÆðÀ´µÄÄ¿±êÀàÐÍ
ʹÓÃ3¸ö¾ßÌåÀàÐ͵Äת»»º¯Êý£¬intval()¡¢floatval()¡¢strval()
ʹÓÃͨÓÃÀàÐÍת»»º¯Êýsettype(mixed var,string type)
µÚÒ»ÖÖת»»·½Ê½£º (int) (bool) (float) (string) (array) (object)
Îı¾²é¿´¸´ÖÆ´úÂë´òÓ¡¹ØÓÚ
<?php
$num1=3.14;
$num2=(int)$num1;
var_dump($num1); //Êä³öfloat(3.14)
var_dump($num2); //Êä³öint(3)
?>
<?php
$num1=3.14;
$num2=(int)$num1;
var_dump($num1); //Êä³öfloat(3.14)
var_dump($num2); //Êä³öint(3)
?>
µÚ¶þÖÖת»»·½Ê½£º intval() floatval() strval()
Îı¾²é¿´¸´ÖÆ´úÂë´òÓ¡¹ØÓÚ
<?php
$str="123.9abc";
$int=intval($str); //ת»»ºóÊýÖµ£º123
$float=floatval($str); //ת»»ºóÊýÖµ£º123.9
$str=strval($float); //ת»»ºó×Ö·û´®£º"123.9"
?>
<?php
$str="123.9abc";
$int=intval($str); //ת»»ºóÊýÖµ£º123
$float=floatval($str); //ת»»ºóÊýÖµ£º123.9
$str=strval($float); //ת»»ºó×Ö·û´®£º"123.9"
?>
µÚÈýÖÖת»»·½Ê½£º settype();
Îı¾²é¿´¸´ÖÆ´úÂë´òÓ¡¹ØÓÚ
<?php
$num4=12.8;
$flg=settype($num4,"int");
var_dump($flg); //Êä³öbool(true)
var_dump($num4); //Êä³öint(12)
?>
<?php
$num4=12.8;
$flg=settype($num4,"int");
var_dump($flg); //Êä³öbool(true)
var_dump($num4); //Êä³öint(12)
?>
365PHPÃâ·ÑÊÓƵ½Ì³ÌÏÂÔØ£º PHP½Ì³ÌÊÓƵ,Ãâ·ÑÊÓƵÏÂÔØ -PHPÊý¾ÝÀàÐÍת»»
×÷ÕߣºÂíÃ÷@PHPÅàѵ PHPÐÞ¶©1.0 2009-09
365PHP£¬ÖйúPHPÔÚÏßÅàѵ
Ïà¹ØÎĵµ£º
ÏÂÃæÊÇһЩ·Ç³£ÓÐÓõÄphpÀà¿â£¬ÏàÐÅÒ»¶¨¿ÉÒÔΪÄãµÄWEB¿ª·¢Ìṩ¸üºÃºÍ¸üΪ¿ìËٵķ½·¨¡£
¡¡¡¡Í¼±í¿â
¡¡¡¡ÏÂÃæµÄÀà¿â¿ÉÒÔÈÃÄãºÜ¼òµÄ´´½¨¸´ÔÓµÄͼ±íºÍͼƬ¡£µ±È»£¬ËüÃÇÐèÒªGD¿âµÄÖ§³Ö¡£
¡¡¡¡PChart - Ò»¸ö¿ÉÒÔ´´½¨Í³¼ÆͼµÄ¿â¡£
¡¡¡¡Libchart - ÕâÒ²ÊÇÒ»¸ö¼òµ¥µÄͳ¼Æͼ¿â¡£
¡¡¡¡JpGraph - Ò»¸öÃæÏò¶ÔÏóµÄͼƬ´´½¨Àà¡£
¡¡¡¡ ......
¡¾Ê²Ã´ÊÇMVC£¿¡¿
MVCÊÇÒ»¸ö¿ÉÒÔÈÃÄã°Ñ“Èý¸ö²¿·Ö£¨¼´MVCµÄÈ«³Æ£¬Model¡¢ View¡¢Controller£©”гµ÷µØ×é³ÉÒ»¸ö¸´ÔÓÓ¦ÓóÌÐòµÄ¸ÅÄî¡£Ò»Á¾Æû³µ¾ÍÊÇÒ»¸öÔÚÏÖʵÉú»îÖзdz£ºÃµÄMVCÀý×Ó¡£ÎÒÃÇ¿´³µ¶¼¿´Á½¸öView£¨ÏÔ Ê¾£©²¿·Ö£ºÄÚ²¿ºÍÍⲿ¡£¶øÕâÁ½¸ö¶¼Àë²»¿ªÒ»¸öController£ ......
<?php
// Á¬½Ó£¬Ñ¡ÔñÊý¾Ý¿â
$dbconn = pg_connect("host=localhost dbname=publishing user=www password=foo")
or die('Could not connect: ' . pg_last_error());
// Ö´ÐÐ SQL ²éѯ
$query = 'SELECT * from authors';
$result = pg_query($query) or die('Query failed: ' . pg_last_error( ......
Ò»¡¢µÇ½
1.½øÈëlinux
2.̞: root
3.¿ÚÁî:123456
4.mysql Óû§Ãû root ÃÜÂë 123456
¶þ¡¢Æô¶¯mysqlÓëapache·þÎñ
1.Æô¶¯mysqÊý¾Ý¿â:/usr/local/mysql/bin/./mysqld_safe --user=mysql &
2.Í£Ö¹mysqlÊý¾Ý¿â:/usr/local/mysql/bin/mysqladmin -u root -p shutdown
3.Æô¶¯apache: /usr/local/apache2/bin/./ap ......
Õ⼸Ì죬ÎÒÔÚѧϰPHPÓïÑÔÖеÄSPL
¡£
Õâ¸ö¶«Î÷Ó¦¸ÃÊôÓÚPHPÖеĸ߼¶ÄÚÈÝ£¬¿´ÉÏÈ¥ºÜ¸´ÔÓ£¬µ«ÊǷdz£ÓÐÓã¬ËùÒÔÎÒ×öÁ˳¤Æª±Ê¼Ç¡£²»È»¼Ç²»×¡£¬ÒÔºóÒªÓõÄʱºò£¬»¹ÊÇÒª´ÓͷѧÆð¡£
ÓÉÓÚÕâÊǹ©×Ô¼º²Î¿¼µÄ±Ê¼Ç£¬²»Êǽ̳̣¬ËùÒÔдµÃ±È½Ï¼òµ¥£¬Ã»Óжà½âÊÍ¡£µ«ÊÇÎÒÏ룬Èç¹ûÄãÊÇÒ»¸öÊìÁ·µÄPHP5³ÌÐòÔ±£¬Ó¦¸Ã×ãÒÔ¿´¶®ÏÂÃæµÄ²ÄÁÏ£¬¶øÇÒ» ......