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

chunk_split

သေးငယ်တဲ့တုံးသို့ string ကိုခွဲ
အမည်:chunk_split
အမျိုးအစား:ကြိုး
programming language:php
တစ်ကြောင်းဖြင့်အကျဉ်းချုပ်:သေးငယ်အစိတ်အပိုင်းများ၏စီးရီးသို့ string ကိုခွဲ။

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

အဆိုပါ chunk_split() function ကိုသေးငယ်တဲ့အစိတ်အပိုင်းများသို့ string ကိုကွဲပြားစေတယ်။

မှတ်ချက် - ဒီ function ကမူရင်း string ကိုမပြောင်းလဲပါဘူး။

နမူနာ

ဥပမာ 1

ဇာတ်ကောင်တစ် ဦး ချင်းစီပြီးနောက်တစ်ကြိမ် string ကိုတစ်ကြိမ်ခွဲပြီး "" add "။ " တစ်ခုချင်းစီကိုအစိတ်အပိုင်းပြီးနောက်:

 <? PHP
$ str = "ရှန်ဟိုင်း" ;
ပဲ့တင်သံ chunk_split ( $ str str , 1 , "။ " ) ;
>

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

ဥပမာ 2

အက်ခရာခြောက်လုံးစီတိုင်းပြီးရင်ကြိုးကိုတစ်ကြိမ်ခွဲပြီး "... " တစ်ခုချင်းစီကိုအပိုင်းပိုင်းထည့်ပြီးတဲ့နောက် "... " ထည့်ပါ။

 <? PHP
$ str = "Hello World!" ;
ပဲ့တင်သံ chunk_split ( $ str , 6 , "... " ) ;
>

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

သဒ္ဒါ

 chunk_split ( string , အရှည် , အဆုံး )
တေးရေး ဖေါ်ပြ
ကြိုး လိုအပ်ပါတယ် ကွဲပြားဖို့ string ကိုဖေါ်ပြသည်။
အရှည် optional ကို။ string ကိုပိတ်ပင်တားဆီးမှု၏အရှည်ကို definging ကိန်းဂဏန်းတန်ဖိုး။ ပုံသေသည် 76 ဖြစ်သည်။
အဆုံး optional ကို။ string တစ်ခုချင်းစီ၏အဆုံးမှာထားတဲ့အရာကိုသတ်မှတ်ထားတဲ့ string ကိုတန်ဖိုး။ default \ r \ n ဖြစ်ပါတယ်။
သက်ဆိုင်သောဖင်ခှ်ရှင်းများ
  • အထူး HTML အဖွဲ့အစည်းများကိုပုံမှန်ဇာတ်ကောင်များသို့ပြန်သွားပါ htmlspecialchars_decode

    htmlspecialchars_decode

    အထူးHTMLအဖွဲ့အစည်းမျ
  • backslash ကိုအသုံးပြုပြီးကြိုးမှထွက်ပြေး addslashes

    addslashes

    backslashကိုအသုံးပြု
  • Locale Settings အပေါ်အခြေခံပြီးကြိုးများနှိုင်းယှဉ် strcoll

    strcoll

    LocaleSettingsအပေါ်အ
  • တစ်ရှုထောင်ခင်းကျင်းတစ် ဦး string ကိုသို့တစ်ရှုထောင်ခင်းကျင်း၏တန်ဖိုးကိုပြောင်းပါ implode

    implode

    တစ်ရှုထောင်ခင်းကျင်း
  • Arrays သို့ CSV strings ကိုခွဲခြမ်းစိတ်ဖြာ str_getcsv

    str_getcsv

    Arraysသို့CSVstrings
  • hexadecimal string ကို binary string ကိုပြောင်းပါ hex2bin

    hex2bin

    hexadecimalstringကို
  • ဖိုင်၏ sha1 hash တန်ဖိုးကိုတွက်ချက်ပါ sha1_file

    sha1_file

    ဖိုင်၏sha1hashတန်ဖို
  • binary လုံခြုံတဲ့ string ကိုနှိုင်းယှဉ် strcmp

    strcmp

    binaryလုံခြုံတဲ့stri
လူကြိုက်များသော ဆောင်းပါးများ