PHP±à³Ì»ù´¡±ØÖª±Ø»á
1.PHP×Ö·û´®²Ù×÷³£Óõķ½·¨
php´®Öл¹ÓÐÒ»¸öÌØÊâµÄ»¨À¨ºÅ²Ù×÷·û¡£µ±ÓÃË«ÒýºÅÖ¸¶¨×Ö·û´®Ê±£¬ÆäÖеıäÁ¿»á±»½âÎö¡£ÔÚË«ÒýºÅÖеĴ®ÖÐÈç¹ûÓöµ½$£¬½âÎöÆ÷»á¾¡¿ÉÄܶàµØÈ¡µÃºóÃæµÄ×Ö·ûÒÔ×é³ÉÒ»¸öºÏ·¨µÄ±äÁ¿Ãû£¬Èç¹ûÏë±íʾָ¶¨Ãû×ֵĽáÊø£¬Óû¨À¨ºÅ°Ñ±äÁ¿ÃûÀ¨ÆðÀ´¡£Çë¿´ÒÔÏ´úÂ룺
<?php
$beer = 'heineken';
echo "he drank some $beers"; //Êä³ö"he drank some"
echo "he drank some ${beer}s";//Êä³ö"he drand some hinekens"
$arr = array('first'=>'here','second'=>'there');
echo "{$arr['first']} is fine."; //Êä³ö"here is fine"
?>
»¨À¨ºÅµÄÁíÒ»¸öÓ÷¨ÊÇ£¬ÓÃÓÚÈ¡³ö×Ö·û´®ÖеÄij¸öÌض¨×Ö·û£¬¼´Í¨¹ýÔÚ×Ö·û´®Ö®ºóÓû¨À¨ºÅÖ¸¶¨×Ö·û´ÓÁ㿪ʼµÄÆ«ÒÆÁ¿À´·ÃÎÊ¡£ÈçÉÏÀýÖÐ"$beer"ÖеĵÚÈý¸ö×Ö·û"i"¿ÉÒÔÈ¡³ö£º"$beer{2}".
ʹÓÓord()"ºÍ"chr()"º¯Êý¿ÉÒÔʵÏÖ×Ö·û±àÂëºÍ×Ö·ûÖ®¼äµÄת»»¡£Èç"ord('A')"µÃÕûÊýÖµ65£»"chr(65)"µÃ×Ö·û"A"¡£
ÒÔÏÂÁгöÁËһЩ³£ÓõĴ®²Ù×÷º¯ÊýµÄ×÷Óá£
->trim()º¯Êý£ºÈ¥³ý´®Í·Î²µÄ¿Õ°××Ö·û¡£
->strtolower()º¯Êý£º½«´®×ªÎªÐ¡Ð´¡£
->strtoupper()º¯Êý£º½«´®×ªÎª´óд¡£
->ucfirst()º¯Êý£º ½«´®µÄÊ××ÖĸתΪ´óд¡£
->strlen()º¯Êý£º»ñÈ¡´®µÄ³¤¶È¡£
->strpos()º¯Êý£º²éÕÒ×Ó´®ÔÚ´®ÖÐÊ״γöÏÖµÄλÖá£
->substr()º¯Êý£º»ñÈ¡×Ó´®¡£
->str_replace()º¯Êý£ºÌæ»»´®ÖеÄ×Ó´®¡£
2.Êý×é×÷Ϊ¶ÑÕ»ºÍ¶ÓÁÐ
->array_push()º¯Êý£º½«Ò»¸ö»ò¶à¸öµ¥ÔªÑ¹ÈëÊý×éµÄĩ⣨ÈëÕ»£©¡£
->array_pop()º¯Êý£º½«Êý×é×îºóÒ»¸öµ¥Ôªµ¯³ö£¨³öÕ»£©¡£
->array_shift()º¯Êý£º½«Êý×鿪ͷµÄµ¥ÔªÒƳöÊý×é¡£
->array_unshift()º¯Êý£ºÔÚÊý×鿪ͷ²åÈëÒ»¸ö»ò¶à¸öµ¥Ôª¡£
->reset()º¯Êý£ºÈ¡³öÊý×éµÚÒ»¸öÔªËØ¡£
->end()º¯Êý£ºÈ¡³öÊý×é×îºóÒ»¸öÔªËØ¡£
->count()º¯Êý£ºÈ¡µÃÊý×éÖÐÔªËصĸöÊý¡£
½áºÏʹÓÃ"array_push()"ºÍ"array_pop()"ÒÔ¼°"array_shift()"ºÍ"array_unshift()"º¯Êý£¬¿ÉÒÔºÜÈÝÒ×µØʵÏÖ¶ÑÕ»²Ù×÷£¬Í¬Ñù½áºÏ"array_push()"ºÍ"array_shift()"ÒÔ¼°"array_unshift()"ºÍ"array_pop()"º¯Êý¾Í¿ÉÒÔºÜÈÝÒ×µØʵÏÖ´Ó¶ÓÁвÙ×÷¡£
3.±éÀúÊý×é
ʹÓÃÒ»¸öforÑ»·Óï¾äºÍforeachÑ»·Óï¾ä¿ÉÒÔºÜÈÝÒ׵رéÀúÒ»¸öÊý×é¡£µ«Ôڴ˽éÉܵIJ»ÊÇʹÓÃÑ»·Óï¾ä±éÀúÊý×飬¶øÊÇÓÃ"array_walk()"º¯Êý¡£¸Ãº¯ÊýÔÚҪΪÊý×éÖеÄÿһ¸öÔªËØÖ´ÐÐÒ»ÏÂÏàͬµÄ²Ù×÷ʱºÜÓÐÓá£ÆäÓ÷¨ÈçÏÂÃæµÄ´úÂëËùʾ£º
<
Ïà¹ØÎĵµ£º
ÕªÒª ±¾ÎĽéÉÜPHPµÄÓŵãºÍÌØÕ÷£¬½áºÏʵÀý²ûÊöÁËPHP·ÃÎÊMySQLÊý¾Ý¿âµÄ·½·¨¡£
PHP MySQL ODBC
1. ÒýÑÔ
ÔÚInternetÓ¦ÓÃÖУ¬½«·þÎñÆ÷¶Ë½Å±¾¼¼ÊõºÍ¿Í»§¶Ë½Å±¾¼¼Êõ½áºÏÆðÀ´¿ÉÒÔÖÆ×÷³ö·á¸»¶à²ÊµÄÒ³Ãæ¡£CGIºÍASPÊDZȽÏÁ÷ÐеķþÎñÆ÷¶Ë½Å±¾¼¼Êõ¡£Í¨³£CGIÔÚ¿çƽ̨µÄ¿ª·¢ÖаçÑÝ×ÅÖ÷Òª½ÇÉ«£¬¿ÉÒÔʹÓÃVB¡¢C»òPerlµÈÀ´Ê ......
Óõ½µÄXMLÎļþ»¹ÒÔ“Php Xml´¦ÀíÖ®simplexmlʹÓ÷½·¨Ç³Ì¸”Ò»ÎÄÖеÄXMLΪÀý£¬ÎļþÃûΪ£ºme.xml¡£´úÂëÈçÏ£º
PHP XML´¦ÀíXML´úÂë
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
<
phplamp
>
& ......
Á¬½Ó£º
$conn=mysql_connect ("localhost:3306", "username", "password");
mysql_select_db("DBname");
¶Á£º
$exec="select * from stu";
$result=mysql_query($exec);
while($rs=mysql_fetch_object($result))
{
echo $rs->id." & ......
£±£®Ëæ»ú×Ö·ûÐòÁÐÉú³Éº¯Êý£º
<?php
//ÓÃÓÚÑéÖ¤ÂëÐòÁÐÉú³ÉµÈ..
function random($length) {
$hash = '';
$chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz';
$max = strlen($chars)-1;
$length=4;//³¤¶È×ÔÐÐÉ趨
mt_srand((double)microtime() * 1000000);
for($i = 0; $i < ......
×î½üÔÚ×öPHPÓëÊý¾Ý¿â½»»¥µÄproject£¬¼±ÓÚÇó³É£¬Ä£·ÂÁËÏÂÀý×ӾͿªÊ¼¶¯ÊÖ£¬½á¹ûÎó°Ñmysql_fetch_arrayд³ÉÁËmysql_fetch_row,囧ÊÂÀ´ÁË£¬·¢ÏÖ·µ»ØµÄÊý×é¾ÓÈ»ÊÇindex=>valueµÄÐÎʽ£¬¶øÃ÷Ã÷¼ÇµÃÊÇfield name=>valueµÄ¹þ£¬²éÊÖ²á²ÅÃ÷°×¡£
1. mysql_fetch_arrayµÄº¯ÊýÔÐÍÊÇ
array mysql_fetch_array ( resour ......