လက်ရှိတည်နေရာ: ပင်မစာမျက်နှာ> ဖန်ရှင်အမျိုးအစားများ> str_pad

str_pad

အရှည်အတွက် string ကိုဖြည့်ရန်အခြား string ကိုသုံးပါ
အမည်:str_pad
အမျိုးအစား:ကြိုး
programming language:php
တစ်ကြောင်းဖြင့်အကျဉ်းချုပ်:ကြိုးအသစ်တစ်ခုနှင့်အတူ string ကိုဖြည့်ပါ။

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

str_pad() function သည် string ကိုအလျားအသစ်ဖြင့်ဖြည့်ပေးသည်။

နမူနာ

ဥပမာ 1

string ၏ညာဘက်အခြမ်းကိုစာလုံးရေ 30 အထိဖြည့်ပါ။

 <? PHP
$ str = "Hello World" ;
ECHO strust_pad ( $ str , 30 , "။ " ) ;
>

သင်ကိုယ်တိုင်စမ်းကြည့်ပါ

ဥပမာ 2

ကြိုး၏ဘယ်ဘက်ခြမ်းကိုဖြည့်ပါ။

 <? PHP
$ str = "Hello World" ;
ECHO strust_pad ( $ str , 30 , 30, "။ " , strow_pad_left ) ;
>

သင်ကိုယ်တိုင်စမ်းကြည့်ပါ

ဥပမာ 3

string ကိုနှစ်ဖက်စလုံးကိုဖြည့်ပါ။

 <? PHP
$ str = "Hello World" ;
echo strow_pad ( $ str , 30 , 30 "။ :" strow_pad_both ) ;
>

သင်ကိုယ်တိုင်စမ်းကြည့်ပါ

သဒ္ဒါ

 strow_pad ( string , အရှည် , pad_string , pad_type )
တေးရေး ဖေါ်ပြ
ကြိုး လိုအပ်ပါတယ် ဖြည့်ဖို့ string ကိုဖေါ်ပြသည်။
အရှည် လိုအပ်ပါတယ် အသစ်သော string ကိုအရှည်ကိုဖေါ်ပြသည်။ အကယ်. တန်ဖိုးသည် string ၏မူလအရှည်ထက်နည်းသည်ဆိုပါကဘာမှမလုပ်ပါ။
pad_string optional ကို။ padding များအတွက် string ကိုဖေါ်ပြသည်။ ပုံသေသည်အလွတ်ဖြစ်သည်။
pad_type

optional ကို။ ဖြည့်ရန် string ကို၏အခြမ်းကိုဖေါ်ပြသည်။

ဖြစ်နိုင်သောတန်ဖိုးများ:

  • strow_pad_both - string ကိုနှစ်ဖက်စလုံးကိုဖြည့်ပါ။ တောင်မှတောင်မှတောင်မှညာဘက်ခြမ်းအပို padding ရရှိသွားတဲ့။
  • strow_pad_left - string ၏ဘယ်ဘက်ခြမ်းကိုဖြည့်ပါ။
  • strow_pad_right - string ၏ညာဘက်အခြမ်းဖြည့်ပါ။ ပုံမှန်။
သက်ဆိုင်သောဖင်ခှ်ရှင်းများ
  • string ကိုစာလုံးအကြီးသို့ပြောင်းပါ strtoupper

    strtoupper

    stringကိုစာလုံးအကြီး
  • အခြား string တစ်ခုသို့ array သို့ခွဲရန် string တစ်ခုကိုသုံးပါ explode

    explode

    အခြားstringတစ်ခုသို့
  • String ပထမ ဦး ဆုံးပေါ်လာသည့်နေရာကိုရှာပါ (ကိစ္စတွင်မခံစားနိုင်သော) stripos

    stripos

    Stringပထမဦးဆုံးပေါ်လ
  • ကြိုး၏ soundex key ကိုတွက်ချက်ပါ soundex

    soundex

    ကြိုး၏soundexkeyကိုတ
  • string ကိုပေးထားသော substring နှင့်အတူအဆုံးသတ် str_ends_with

    str_ends_with

    stringကိုပေးထားသောsu
  • output ကို format ချ string ကို printf

    printf

    outputကိုformatချstr
  • ချုံ့ရန် formatted ကြိုးရေးပါ vfprintf

    vfprintf

    ချုံ့ရန်formattedကြိ
  • စုံစမ်းမှုဘာသာစကားနှင့်ဒေသဆိုင်ရာသတင်းအချက်အလက်များ nl_langinfo

    nl_langinfo

    စုံစမ်းမှုဘာသာစကားနှ
လူကြိုက်များသော ဆောင်းပါးများ