Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

PHPѧϰ±Ê¼Ç

// Á¬½ÓÁ½¸ö×Ö·û´®
<?php
    $txt1 = "Hello";
    $txt2 = "PHP";
    echo $txt1." ".$txt2;
?>
// È¡µÃ×Ö·û´®ÖеÄ×Ö·ûÊý
<?php
    $txt1 = "Abc";
    echo strlen($txt1);
?>
// È¡µÃtargetÔÚareaÖгöÏÖµÄÊ×λÖÃ
<?php
    $area = "012php";
    $target = "php";
    echo strpos($area, $target);
    echo "\n";
    echo strpos($area, "PHP");
?>
// ËãÊýÔËËã·û
<?php
    $intA = 9;
    $intB = 3;
   
    $intSum = $intA + $intB;
    $intSub = $intA - $intC;
    $intMul = $intA * $intB;
    $intExc = $intA / $intB;
    $intMod = $intA % $intB;
       
    echo "intA + intB = ".$intSum;
    //echo ;
    echo "intA - intB = ".$intSub;
    echo "intA * intB = ".$intMul;
    echo "intA / intB = ".$intExc;
    echo "intA % intB = ".$intMod;
    echo "intA++ == ".$intA++;
    echo "intA-- == ".$intA--;
?>
// º¯Êý
<?php
    function myFunc()
    {
        echo "hello function";
    }
   
    myFunc();
?>
// PHPºÍHTML
<html>
<head>
<title> Title </title>
</head>
<body>
<?php
    function myFunc()
    {
        echo "hello function";
    }
    myFunc();
    echo "<hr /&


Ïà¹ØÎĵµ£º

·ÖÎöPHPÖеĻº´æ¼¼Êõ

¹ØÓÚPHPµÄ»º´æ¼¼ÊõÎÒ¸öÈ˵Ķ¨ÒåÊÇ¿ÉÒÔ·Ö³É3¸öÀà±ð1;
»º´æÄ£¿éÕâÕâ¸öÊÇÔÚ·þÎñÆ÷ÉÏ×öµÄ»º´æÉèÖÃ, ±ÈÈçZend¹«Ë¾µÄCache²úÆ·µÈ, Ö÷ÒªÔ­ÀíÊÇͨ¹ý¶ÔPHP´úÂëÎļþµÄÒ»´Î±àÒë±£´æÔÚÄÚ´æÖÐ, ͨ¹ý¼õÉÙI /OµÄ²Ù×÷À´¼Ó¿ì·ÃÎÊËÙ¶È, ²»ÔÚ±¾ÎÄÌÖÂÛ·¶Î§Ö®ÁÐ2;
HTML·½Ê½»òÐíÄã˵PHPÉú³ÉHTMLµÄ·½Ê½²»ÔÚ±¾ÎÄÌÖÂ۵ķ¶Î§Ö®ÁÐ, µ«ÊÇÎÒ¸öÈËÈËΪÕâÖ ......

PHP ³£Á¿ dirname(__file__) ѧϰ


PHP ³£Á¿ dirname(__file__)
__FILE__ :±»³ÆΪPHPħÊõ³£Á¿ ,·µ»Øµ±Ç°Ö´ÐÐPHP½Å±¾µÄÍêÕû·¾¶ºÍÎļþÃû,°üº¬Ò»¸ö¾ø¶Ô·¾¶
1£©dirname(__FILE__) º¯Êý·µ»ØµÄÊǽű¾ËùÔÚÔڵķ¾¶¡£   
±ÈÈçÎļþ b.php °üº¬ÈçÏÂÄÚÈÝ£º    
         <?php ......

php»ñµÃ¶þά»ò¶àάÊý×éµÄµÚһάµÄ³¤¶È

ÔÚphpÖУ¬»ñµÃ¶þά»ò¶àάÊý×éµÄµÚһάµÄ³¤¶È£¬ÕâÊǸö³£ÓõijÌÐòÅжϣ¬±ÈÈçÄã¶ÁÈ¡µÄÊý×éÊÇÒ»¸ö¶þάÊý×飺
<?php
$arr=array(
                 0=>array('title' => 'ÐÂÎÅ1', 'viewnum' => 123, 'content' => 'ZAQXSWedcrfv'),
  &nbs ......

PHP $_SERVER[''] ²ÎÊýÏê½â

$_SERVER['PHP_SELF'] #µ±Ç°ÕýÔÚÖ´Ðнű¾µÄÎļþÃû£¬Óë document rootÏà¹Ø¡£
$_SERVER['argv'] #´«µÝ¸ø¸Ã½Å±¾µÄ²ÎÊý¡£
$_SERVER['argc'] #°üº¬´«µÝ¸ø³ÌÐòµÄÃüÁîÐвÎÊýµÄ¸öÊý£¨Èç¹ûÔËÐÐÔÚÃüÁîÐÐģʽ£©¡£
$_SERVER['GATEWAY_INTERFACE'] #·þÎñÆ÷ʹÓÃµÄ CGI ¹æ·¶µÄ°æ±¾¡£ÀýÈ磬“CGI/1.1”¡£
$_SERVER['SERVER_ ......

ÎÒµÄphpÖ®ÂÃ

    ²»Öª´ÓʲôʱºòÃÔÁµÉÏÁËphp£¬ÔÚëüëÊÖ®ÖпªÊ¼ÁËÎҵıà³Ì֮·.......
    Ìý˵csdn¸ßÊÖÈçÔÆ£¬ºÜÏë½áʶ־ͬµÀºÏµÄÅóÓÑ£¬ÎÞÐֵܲ»±à³Ì£¬Ï£Íû´ó¼ÒÒ»Æð¿ªÍØÎÒÃǵÄÇ°³Ì£¬±à³Ì֮·£¬²»Ôٹµ¥Ç°ÐÐ!
    ³É¹¦Ö®Â·ÍäÇú¶øÂþ³¤£¬ÏàÐŲ»Çü²»ÄÓµÄŬÁ¦£¬ÏàÐÅÄêÇᣬʤÀûÒ»¶¨ÊôÓÚÎÒÃÇ£¬¼Ó ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ