Variables are for storing a values, such as text string "Hello World!" or the integer value 4.
A variable can then be reused repeatedly, instead of typing out the value over and over again.
PHP defines a variable with the following form:
Don't forget the dollar sign ($)at the beginning.
It is similar to Algebra (parallel example)
In the example shown below variables ($hello, $a_number and $otherNumber) are given values by using an equal sign [ = ]
PHP does not require variables to be declared before being initialized.
Few rules needed to follow when choosing a name for your PHP variables.
NoteFor more detail please see Php Manual at http://www.php.net
Variables မ်ားကို "Hello World!" ကဲ့သို႔ ေသာ string မ်ား ႏွွင့္ တစ္၊ ႏွစ္၊ သံုး ကဲ့သို႔ ေသာ ဂဏန္း အခ်က္ အလက္ (values) မ်ားကို သိမ္းဆည္း ရန္ အသံုး ျပဳသည္။
အဆိုပါ string မ်ား ႏွွင့္ ဂဏန္း အခ်က္ အလက္ မ်ားကို ထပ္ျပန္ တလဲလဲ ရိုက္ႏွိပ္ ရန္ မလို ဘဲ variables မ်ားကို သံုးျခင္း ျဖင့္ အလုပ္ သက္သာ ေစ ပါသည္။
PHP သည္ variable မ်ားကို ေအာက္ပါ ပံုစံ ျဖင့္ အသံုး ျပဳသည္။
Variable အမည္ ၏ ေရွ့တြင္ $ sign တခု အၿမဲ ရွိ ရမည္ ကို သတိျပဳ ပါ။
Variable ကို ေအာက္ ပါ အကၡရာ သခၤ်ာ ဥပမာ ျဖင့္ ႏွိဳင္းယွဥ္ ေလ့လာ ၾကည့္ပါ။
variables ($hello, $a_number and $otherNumber) တို႔ကို ညီမွ်ျခင္း သေကၤတ [ = ] အသံုးျပဳၿပီး တန္ဖိုး(value) သတ္မွတ္ ပံုကို ေအာက္ပါ ဥပမာ တြင္ ၾကည့္ပါ။
PHP တြင္ variables အသံုး မျပဳမွီ declare လုပ္ရန္ မ လိုပါ။
PHP variables မ်ား အမည္ေပ ရာတြင္ ေအာက္ပါ နည္းစနစ္ မ်ား ကို လိုက္နာ ရန္ လိုအပ္ ပါသည္။.