PHP ကျူတိုရီရယ်

PHP ပင်မစာမျက်နှာ PHP မိတ်ဆက် PHP ထည့်သွင်းပါ။ PHP Syntax PHP မှတ်ချက်များ PHP Variables များ PHP Echo / Print PHP Data အမျိုးအစားများ PHP စာတန်းများ PHP နံပါတ်များ PHP သင်္ချာ PHP Constants PHP Operator များ PHP If...Else...Elseif PHP Switch PHP Loops PHP လုပ်ဆောင်ချက်များ PHP Arrays PHP Superglobals PHP RegEx

PHP Forms

PHP Form ကိုင်တွယ်ခြင်း။ PHP Form Validation PHP Form လိုအပ်ပါသည်။ PHP Form URL/E-mail PHP Form ပြီးပါပြီ။

PHP အဆင့်မြင့်

PHP နေ့စွဲနှင့် အချိန် PHP ပါဝင်ပါတယ်။ PHP ဖိုင်ကိုင်တွယ်ခြင်း PHP ဖိုင်ကို ဖွင့်/ဖတ်ပါ။ PHP ဖိုင်ကို ဖန်တီး/ရေးပါ။ PHP ဖိုင်ကို တင်ခြင်း။ PHP Cookies PHP စက်ရှင်များ PHP Filters PHP Filters Advanced PHP ပြန်ခေါ်ခြင်းလုပ်ဆောင်ချက်များ PHP JSON PHP ခြွင်းချက်

PHP OOP

PHP OOP ဆိုတာဘာလဲ PHP အတန်းများ/အရာဝတ္ထုများ PHP Constructor PHP Destructor PHP Access Modifiers PHP Inheritance PHP Constants PHP Abstract အတန်းများ PHP မျက်နှာပြင်များ PHP လက္ခဏာများ PHP Static Methods PHP Static Properties PHP Namespaces PHP Iterables

MySQL ဒေတာဘေ့စ်

MySQL ဒေတာဘေ့စ် MySQL ချိတ်ဆက်မှု MySQL သည် DB ကိုဖန်တီးပါ။ MySQL ဇယားဖန်တီးပါ။ MySQL သည် Data ကိုထည့်သွင်းပါ။ MySQL နောက်ဆုံး ID ကိုရယူပါ။ MySQL တွင် Multiple ထည့်သွင်းပါ။ MySQL ပြင်ဆင်ထားသည်။ MySQL Data ကို ရွေးပါ။ MySQL ဘယ်မှာလဲ။ MySQL Order By MySQL က Data တွေကို ဖျက်လိုက်ပါ။ MySQL အပ်ဒိတ်ဒေတာ MySQL ကန့်သတ်ဒေတာ

PHP XML

PHP XML ပါဆာများ PHP SimpleXML Parser PHP SimpleXML - ရယူပါ။ PHP XML Expat PHP XML DOM

PHP - AJAX

AJAX နိဒါန်း AJAX PHP AJAX ဒေတာဘေ့စ် AJAX XML AJAX တိုက်ရိုက်ရှာဖွေမှု AJAX စစ်တမ်း

PHP ဥပမာများ

PHP ဥပမာများ PHP Compiler PHP Quiz PHP လေ့ကျင့်ခန်းများ PHP Certificate

PHP အ ကိုးအကား

PHP ခြုံငုံသုံးသပ်ချက် PHP Array PHP ပြက္ခဒိန် PHP နေ့စွဲ PHP လမ်းညွှန် PHP အမှား PHP ခြွင်းချက် PHP ဖိုင်စနစ် PHP Filter PHP FTP PHP JSON PHP သော့ချက်စာလုံးများ PHP Libxml PHP Mail PHP သင်္ချာ PHP ထွေ PHP MySQLi PHP ကွန်ရက် PHP Output Control PHP RegEx PHP SimpleXML PHP Stream PHP String PHP Variable ကိုင်တွယ်ခြင်း။ PHP XML Parser PHP Zip PHP အချိန်ဇုန်များ

PHP money_format() လုပ်ဆောင်ချက်

❮ PHP String အကိုးအကား

ဥပမာ

နိုင်ငံတကာ en_US ဖော်မတ်-

<?php
$number = 1234.56;
setlocale(LC_MONETARY,"en_US");
echo money_format("The price is %i", $number);
?>

အထက်ဖော်ပြပါ ကုဒ်၏ အထွက်သည်-

The price is USD 1,234.56


အဓိပ္ပါယ်နှင့် အသုံးပြုမှု

money_format() လုပ်ဆောင်ချက်သည် ငွေကြေး string တစ်ခုအဖြစ် ဖော်မတ်ထားသည့် စာကြောင်းကို ပြန်ပေးသည်။

ဤလုပ်ဆောင်ချက်သည် ပင်မစာကြောင်းတွင် ရာခိုင်နှုန်း (%) ဆိုင်းဘုတ်ပါရှိသည့် ဖော်မတ်လုပ်ထားသည့် နံပါတ်တစ်ခုကို ထည့်သွင်းသည်။

မှတ်ချက်- money_format() လုပ်ဆောင်ချက်သည် Windows ပလပ်ဖောင်းများတွင် အလုပ်မလုပ်ပါ။

အကြံပြုချက်- ဤလုပ်ဆောင်ချက်ကို setlocale() လုပ်ဆောင်ချက် နှင့် မကြာခဏ တွဲသုံး ပါသည်။

အကြံပြုချက်- ရရှိနိုင်သော ဘာသာစကားကုဒ်များအားလုံးကို ကြည့်ရှုရန်၊ ကျွန်ုပ်တို့၏ ဘာသာစကားကုဒ်ကိုးကားမှုသို့ သွားပါ။


အထားအသို

money_format(string,number)

ကန့်သတ်တန်ဖိုးများ

Parameter Description
string Required. Specifies the string to be formatted and how to format the variables in it.

Possible format values:

Padding and Flags:

  • =f - Specifies the character (f) to be used as padding (Example: %=t this uses "t" as padding). Default is space
  • ^ - Removes the use of grouping characters
  • + or ( - Specifies how to show positive and negative numbers. If "+" is used, the local setting for + and - will be used (usually a sign in front of negative numbers, and nothing in front of positive numbers). If "(" is used, negative numbers are enclosed in parenthesis. Default is "+"
  • ! - Stops the use of currency symbols in the output string
  • - If "-" is used, all fields are left-justified. Default is right-justified

Field width:

  • x - Specifies the minimum field width (x). Default is 0
  • #x - Specifies the maximum number (x) of digits expected to the left of the decimal point. This is used to keep formatted output aligned in the same columns. If the number of digits are bigger than x, this specification is ignored
  • .x - Specifies the maximum number (x) of digits expected to the right of the decimal point. If x is 0, the decimal point and the digits to its right will not be shown. Default is local settings

Conversion characters:

  • i - The number is formatted to international currency format
  • n - The number is formatted to national currency format
  • % - Returns the % character

Note: If multiple format values are used, they must be in the same order as shown above.

Note: This function is affected by local settings.

number Required. The number to be inserted at the %-sign in the format string


နည်းပညာဆိုင်ရာအသေးစိတ်

ပြန်ပို့တန်ဖိုး- ဖော်မတ်လုပ်ထားသည့် စာကြောင်းကို ပြန်ပေးသည်။ ဖော်မတ်ချသည့်စာကြောင်း ရှေ့နှင့်နောက်တွင် စာလုံးများကို မပြောင်းလဲဘဲ ပြန်ပေးပါမည်။ ကိန်းဂဏာန်းမဟုတ်သောနံပါတ်များသည် NULL ပြန်ဖြစ်လာပြီး E_WARNING ကို ဖြစ်ပေါ်စေသည်။
PHP ဗားရှင်း- 4.3.0+

နောက်ထပ် ဥပမာများ

ဥပမာ

ဒဿမ 2 ဖြင့် နိုင်ငံတကာဖော်မတ် (ဂျာမနီ)

<?php
$number = 1234.56;
setlocale(LC_MONETARY,"de_DE");
echo money_format("%.2n", $number);
?>

အထက်ဖော်ပြပါ ကုဒ်၏ အထွက်သည်-

1 234,56 EUR

ဥပမာ

အနုတ်နံပါတ်၊ အနုတ်နံပါတ်များနှင့် မှန်ကန်တိကျမှု၏ ဂဏန်း ၂ လုံးကို ညွှန်ပြရန် () ပါသော အမေရိကန်ပြည်ထောင်စု ဖော်မတ်-

<?php
$number = -1234.5672;
echo money_format("%=*(#10.2n",$number);
?>

အထက်ဖော်ပြပါ ကုဒ်၏ အထွက်သည်-

(******1234.57)


❮ PHP String အကိုးအကား