分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > 代码编程

【php练习源码】

发布时间:2023-09-06 02:11责任编辑:苏小强关键词:暂无标签
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;?>";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=<<name="hellow world"; ???} ???function __destruct(){ ???????print $this->name; ???}}$obj=new myClassTow();?>url=$par; ???}*/ ?/* ?????function __construct($par1,$par2) ???{ ???????$this->url=$par1; ???????$this->auth=$par2; ???} ???function getUrl(){ ???????echo $this->url.PHP_EOL; ???} ???/*function setAuth($par){ ???????$this->auth=$par; ???}*/ ???function getAuth(){ ???????echo $this->auth.PHP_EOL; ???}}class myChildClass extends myClass{ ???var $number; ???function setNumber($par){ ???????$this->number=$par; ???} ???function getNumber(){ ???????echo $this->number; ???}}$y=new myChildClass();$y->setNumber("1");$y->getNumber();$x=new myClass("www.xiaomo.com","lp");#$x->setUrl("www.xiaomohk.cn");$x->getUrl();//echo "hellow".PHP_EOL."world";/*declare(encoding=‘UTF-8‘);namespace project;echo __NAMESPACE__;*/?>myFuction(1,2);*/?>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;$x20,"wine"=>100,"mac"=>6);asort($money);ksort($money);arsort($money);krsort($money);foreach($money as $x=>$x_value){ ???echo $x_value; ???echo $x;}$age=19;switch ($age) { ???case $ageaArry[0]: ???echo "you age is 19"; ???break; ???case $ageaArry[1]: ???echo "you age is 20"; ???break; ???case $ageaArry[2]: ???echo "you age is 1"; ???default: ???echo "you age is 25";}$sum=0;for($x=0;$x<=100;$x++){ ????$sum=$sum+$x; ????$x++; ????echo $sum;}/*do{ ???$x=1; ???????$x++; ???echo $x; ???????echo"
";}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;$x20,"wine"=>100,"mac"=>6);asort($money);ksort($money);arsort($money);krsort($money);foreach($money as $x=>$x_value){ ???echo $x_value; ???echo $x;}$age=19;switch ($age) { ???case $ageaArry[0]: ???echo "you age is 19"; ???break; ???case $ageaArry[1]: ???echo "you age is 20"; ???break; ???case $ageaArry[2]: ???echo "you age is 1"; ???default: ???echo "you age is 25";}sum=0for($x=0;$x<=100;$x++){ ????$sum=$sum+$x; ????$x++; ????echo $sum;}/*do{ ???$x=1; ???????$x++; ???echo $x; ???????echo"
";}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练习源码】

原文地址:https://www.cnblogs.com/activecode/p/9535005.html

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved