章节
笔记
提问

php入门教程之一周学会PHP

php常量和变量之可变变量

可变变量,这个词解释的太过于高大上。看起来很有“bigger”。它还有一个叫法,叫作变量的变量。

我们认为这些叫法上都不太科学。毕竟都是翻译过来的舶来之物。

可变变量其实就是——已声明的变量前,再上变量符。

举例说明:

<?php
   //定义了一个变量叫作 $shu 将$shu这个变量的值设为字符串的biao
   $shu = 'biao';
   //定义了一个【变量】$biao。将他的值设置为鼠标
   $biao = '鼠标';

   //$$shu 就是可变变量:在已声明的变量$shu前又加上了一个变量符
   echo $$shu;
?>

上面的过程说明:$shu的值为字符串的'biao'。我在$shu前再加上一个$(美元符号),可以理解成为以下的变形过程:

<?php &nbu = 'biao'; &nbao = '鼠w39;; &nbawbsp;= '鼠test9;; &nbatest9p;= '鼠sina9;; &nbasina9p;= '鼠zhonggu39;; &nbazhonggu39p;= '鼠china9;; &nbachina9p;= '鼠在爱你9;; &nb䈫运行这䮚䷱去推之蛪友码

上sp >yle="co'th:400100%;or:#b5bfff;'ef="/code/1040.html" ti>继续习

第||pan>>
< mar-less.ft: ;">新建件<>
php编tyle="widt-size乻:;$shoa;?php &nb 义了一个变量叫作&nb u; ? $shu这个变量的值设为字符串的biao &nb u; ? = 'o &n';b 义了一个变变量】$biao。将他的值设置为鼠标 &nb o = '标 &n';bb $u; ? $s可变变量:在已声明的变量$shu前又加上了一个变量符 &nbho 显hu; ?>
-in" cltyref="/coascript:;" id=ss="code-desb>-submit rd="J_CodeDmmititle="文䏏纤">䏏纤>-reset d="J_CodEditorResetitle="通臍"><码< class="nanraaotoruyle="co"play='n: bk"><
第||pan>>
i>i>
br>可否他的仑到问答国>
< code-e-shamenuita-id=owe_Caltita-id=sortodtastdivclass="sece-e-shamenunitcl"tylass="coucce;le"ef="/coascript:;" id="js-plMenui>窄论><><><><><
< pubtishnp"><-pldiv class="nanpl-inputnp">>yvalu学䏑联媄论" /div>
k"reimg th:40="40"efht at="40"esrccohttp://www.....cndstcle-/imag s/ussi_scrtar.jpgitle="php编cn_u990ht" althp编cn_u990ht"li>i>k"r编cn_u990hti>i>v>i>
k"reimg th:40="40"efht at="40"esrccohttp://img.....cndupload/scrtar/000/000/001/e53f7f21be9fae8d3878a2f29a0d0cb8.jpgitle="php飞翨值䰏墨鱼" althp飞翨值䰏墨鱼"li>i>k"r飞翨值䰏墨鱼i>i>v>i>
k"reimg th:40="40"efht at="40"esrccohttp://img.....cndupload/scrtar/000/000/001/6f7e9928e1bb8274ad62b72f66a1830c.jpgitle="php青草地" althp青草地"li>i>k"r青草地i>i>v>i>
k"reimg th:40="40"efht at="40"esrccohttp://img.....cndupload/scrtar/000/000/001/4cfb7748fa055125a0ac9072d195d06b.jpgitle="php王由华" althp王由华"li>i>k"r王由华i>i>v>i>
k"reimg th:40="40"efht at="40"esrccohttp://img.....cndupload/scrtar/000/000/001/4cfb7748fa055125a0ac9072d195d06b.jpgitle="php王由华" althp王由华"li>i>k"r王由华i>i>v>i>k"reimg th:40="40"efht at="40"esrccohttp://img.....cndupload/scrtar/000/000/001/b3b146d5b24efb0a08b67ff99218748b.jpgitle="php勾">i>k"r勾">i><>i>i>i>< class="nanop quest">< codnelect-stcl
n>>
n>>
k"reimg srccohttp://img.....cndupload/scrtar/000/000/001/cafa85eee20562887c9a20fe460831cf.jpgitth:40="40"efht at="40"li>i>k"r博龙i>i>

量和变量之可变变量

class="nannotetistntain" t-mori>

注保存i>i>3星期又pan>
k"reimg srccohttp://img.....cndupload/scrtar/000/000/001/69d5087edbec9288ee6a7f0d1668267b.jpgitth:40="40"efht at="40"li>i>k"rnelfimperi>i>

鏘变量

class="nannotetistntain" t-mori>注保存i>i>1变月又pan>k"reimg srccohttp://img.....cndupload/scrtar/000/000/001/bed64b9ac480ae3a41177114bbca5bf8.jpgitth:40="40"efht at="40"li>i>k"r成鴀张家i>i>

@1237 用该中$hu;ina输出才—‘在爱你’re>

class="nannotetistntain" t-mori>注保存i>i>4变月又pan>k"reimg srccohttp://img.....cndupload/scrtar/000/000/001/e3a176acc580c9ee930fbb6cb72a66ea.jpgitth:40="40"efht at="40"li>i>k"r王zzzzzzzz聪i>i>

起太有点累re>

class="nannotetistntain" t-mori>注保存i>i>5变月又pan>k"reimg srccohttp://www.....cndstcle-/imag s/ussi_scrtar.jpgitth:40="40"efht at="40"li>i>k"r1237i>i>

hu; ?=o=标 &nb hu$hu; ?=u$hubaio=u$hwo=u$test=u;ina=zhonggu3 如果要输出‘在爱你’则—7$(这丘以理hu;inare>

class="nannotetistntain" t-mori>注保存i>i>9变月又pan>k"reimg srccohttp://img.....cndupload/scrtar/000/001/063d58bf7346affbe970.pngitth:40="40"efht at="40"li>i>k"r十口冂二i>i>

h&nb = 'o &n';bo = '标 &n';bo 显hu; ?&g hu; ? o:量o4bsp;l 'o &n'} 把量$shu前释的量纆ose>

class="nannotetistntain" t-mori>注保存i>i>10变月又pan>k"reimg srccohttp://img.....cndupload/scrtar/000/000/001/cafa85eee20562887c9a20fe460831cf.jpgitth:40="40"efht at="40"li>i>k"r博龙i>i>

量和变量之可变变量

class="nannotetistntain" t-mori>注保存i>i>3星期又pan>k"reimg srccohttp://img.....cndupload/scrtar/000/000/001/69d5087edbec9288ee6a7f0d1668267b.jpgitth:40="40"efht at="40"li>i>k"rnelfimperi>i>

鏘变量

class="nannotetistntain" t-mori>注保存i>i>1变月又pan>k"reimg srccohttp://img.....cndupload/scrtar/000/000/001/bed64b9ac480ae3a41177114bbca5bf8.jpgitth:40="40"efht at="40"li>i>k"r成鴀张家i>i>

@1237 用该中$hu;ina输出才—‘在爱你’re>

class="nannotetistntain" t-mori>注保存i>i>4变月又pan>k"reimg srccohttp://img.....cndupload/scrtar/000/000/001/e3a176acc580c9ee930fbb6cb72a66ea.jpgitth:40="40"efht at="40"li>i>k"r王zzzzzzzz聪i>i>

起太有点累re>

class="nannotetistntain" t-mori>注保存i>i>5变月又pan>k"reimg srccohttp://www.....cndstcle-/imag s/ussi_scrtar.jpgitth:40="40"efht at="40"li>i>k"r1237i>i>

hu; ?=o=标 &nb hu$hu; ?=u$hubaio=u$hwo=u$test=u;ina=zhonggu3 如果要输出‘在爱你’则—7$(这丘以理hu;inare>

class="nannotetistntain" t-mori>注保存i>i>9变月又pan>k"reimg srccohttp://img.....cndupload/scrtar/000/001/063d58bf7346affbe970.pngitth:40="40"efht at="40"li>i>k"r十口冂二i>i>

h&nb = 'o &n';bo = '标 &n';bo 显hu; ?&g hu; ? o:量o4bsp;l 'o &n'} 把量$shu前释的量纆ose>

class="nannotetistntain" t-mori>注保存i>i>10变月又pan>推荐课程hclass="heaother-tistdivk"ren styss="nano" d oheip">i>k"ren styss="nano" d oheip">i>k"ren styss="nano" d oheip">i>k"ren styss="nano" d oheip">i>k"ren styss="nano" d oheip">i>k"ren styss="nano" d oheip">i>k"ren styss="nano" d oheip">i>k"ren styss="nano" d oheip">i>k"ren styss="nano" d oheip">i>k"ren styss="nano" d oheip">i>k"ren styss="nano" d oheip">i>k"ren styss="nano" d oheip">i>k"ren styss="nano" d oheip">i>k"ren styss="nano" d oheip">n>i>k"ren styss="nano" d oheip">i>k"ren styss="nano" d oheip">i>k"ren styss="nano" d oheip">i>k"ren styss="nano" d oheip">i>k"ren styss="nano" d oheip">i>k"ren styss="nano" d oheip">n>i>>

<
phpan>第16记>i>
i class="nannote-poi class="nanqa-po<-area">i class="nanqa-tainrol qa-:;"-le">
< arfix">
< po<-foot clty class="nanverifyae-de arfix">< ativerifya="/reshd=hidefocunantrueetf="/coascript:;" void(0)"i>i class="nane-n-colivsece;onass="nanrsiner" clty id=ss="nanrrfix">tivddliref="/coascript:;" void(0)"a"J_Ctime_rflo"l我注交卷i>i>divddliref="/coascript:;" void(0)"a"J_Ctime_pause"l暂停i>i>divddliref="/coascript:;" void(0)"a"J_Cexamine_next_elose"l友次加䁚i>i>div/dlty class="nanmt20spa lass="heapaper-test q-card-bo< q-card-p">div/dltyv>