php练习源码
Posted Active_Code
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php练习源码相关的知识,希望对你有一定的参考价值。
Something is wrong with the XAMPP installation :-( value[$name]=$sex; } public function getInfomation($myClass){ foreach($this->vars as $name=>$value){ $myClass=str_replace(‘{‘.$name.‘}‘,$value,$myClass); } return $myClass; } } class myClassTow{ public static $age=18; const constant=‘常量‘; function myFunction(){ echo self::constant.PHP_EOL; } } echo myClassTow::constant; echo myClassTow::$age; ?> php $x="liu"; $x{3}="p"; $x=$x."eng"; print $x; //$x; #$sum="php注释:#,//,/**/"; /* $!a=1; echo ""; echo $!a; */ /* for($x=0;$x<5;$x++){ $sum=$sum+$x; // echo "hello world"; } */ //echo $sum; ?> "; print $php; unset($x); //取消变量的定义 if(empty($y)/*isset($x)*/){ //判断变量是不是存在 print ‘$x定义好了‘; } //echo "
"; else{ print ‘$x未定义好‘; } #定界符 /* $z=<<
"; }while(true); $x=1; while (true){ $x++; echo $x; echo"
"; } //echo $_SERVER["PHP_SELF"]; */ ?> 6 and $x<8){ echo "you have get up"; } else if($x>9 and $x<12){ echo "you have work"; } else{ echo "you have game"; } $ageaArry=array(19,20,1,25); echo count($ageaArry); //sort($ageaArry); rsort($ageaArry); for($x=0;$x
"; }while(true); $x=1; while (true){ $x++; echo $x; echo"
"; } //echo $_SERVER["PHP_SELF"]; */ ?> "; echo $x++; echo $x++; echo ++$x;//自增运算符,--:自减 var_dump ($x>1);//比较运算符 echo $x>1 or $x<1 ;//逻辑运算符 $x=array("name"=>"zs","sex"=>"man"); $y=array("name"=>"ls","sex"=>"woman"); #$z=$x+$y; var_dump($x <> $y);//数组运算符 $q="hellow world"; $z=$q ?: ‘none‘;echo $z,PHP_EOL;//三元运算符 ?> habbit=$habbit; } function myFunctionfou(){ return $this->habbit; } } $p=new myClass(); $q=null;//空 var_dump($x); echo "
"; var_dump($y); echo "
"; var_dump($z); echo "
"; var_dump($w); echo "
"; var_dump($q); echo "
"; var_dump($p); ?> "; function myFunctionTow($z){ echo $z; } myFunctionTow(18); /*echo $x; myFunction(); echo $x; */ ?> "; print "hellow world"; //这是一个注释 /*这也是一个注释 */ echo "
"; ?> "; echo $y; //echo $y; } myFunction(); echo $y; */ ?>?php >>1>?php $x=1; echo>=100;$x++){ >12){ >8){ >?php $x=date("H"); if>=100;$x++){ >12){ >8){ >?php /* $x=date("H"); if>?php /*//echo>?php class>?php /* class>?php $x="ph$np"; echo>?php $x=1; function>?php $x="liu"; $x{3}="p"; $x=$x."eng"; print>?php interface>?php list($width,$height,$type,$attr)=getimagesize("1.png"); echo>?php if>
以上是关于php练习源码的主要内容,如果未能解决你的问题,请参考以下文章