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

substr_compare

Binary Safe နှိုင်းယှဉ်မှု string ကို (သတ်မှတ်ထားသောအရှည်ကို offset အနေအထားနှင့်နှိုင်းယှဉ်ပါ)
အမည်:substr_compare
အမျိုးအစား:ကြိုး
programming language:php
တစ်ကြောင်းဖြင့်အကျဉ်းချုပ်:သတ်မှတ်ထားသောစတင်သည့်အနေအထားမှကြိုးနှစ်ချောင်းကိုနှိုင်းယှဉ်ပါ (binary ဘေးကင်းလုံခြုံမှုနှင့်ရွေးချယ်မှုအထိခိုက်မခံပါ) ။

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

substr_compare() function ကို) function နှစ်ခု strings နှစ်ခု string နှစ်ခုနှင့်နှိုင်းယှဉ်။

ထိပ်ဖ်ား: ဤလုပ်ဆောင်ချက်သည် binary safe and case ကို Sensitive ဖြစ်သည်။

နမူနာ

ဥပမာ 1

ကြိုးနှစ်ချောင်းကိုနှိုင်းယှဉ်ပါ။

 <? PHP
echo substr_cappare ( "Hello World" , "Hello World" , 0 ) ;
>

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

ဥပမာ 2

string1 ကိုနှိုင်းယှဉ်လျှင်စသည့် string နှစ်ခုကိုနှိုင်းယှဉ်ကြည့်ပါ။

 <? PHP
echo substr_cappare ( "Hello World" , "World" , 6 ) ;
>

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

ဥပမာ 3

parameters အားလုံးကိုသုံးပါ။

 <? PHP
Echo Substr_ClayChare ( "World" , "သို့မဟုတ်" , 1 , 2 ) ;
Echo Substr_ClayChare ( "World" , "LD" , - 2 , 2 ) ,
echo substr_cappare ( "လောက" , "orl" , 1 , 2 ) ;
echo substr_cappare ( "World" , "သို့မဟုတ်" , 1 , 2 , စစ်မှန်သော ) ;
echo substr_cappare ( "လောက" , "သို့မဟုတ်" , 1 , 3 ) ;
Echo Substr_ClayChare ( "World" , "RL" , 1 , 2 ) ;
>

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

ဥပမာ 4

ကွဲပြားခြားနားသောပြန်လာတန်ဖိုးများ:

 <? PHP
Echo Substr_Compare ( "Hello World!" , "Hello World!" , 0 ) ; // နှစ်ခု strings တန်းတူဖြစ်ကြသည်
echo substr_cappare ( "Hello World!" , "ဟဲလို" , 0 ) ; // string1 string2 ထက်သာ။ ကြီးမြတ်သည်
echo substr_cappare ( "Hello World!" , "Hello World! မင်္ဂလာပါ!" , 0 ) ; 0 ) ; // string1 string2 ထက်နည်းသည်
>

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

သဒ္ဒါ

 substr_cappare ( string1 , string2 , startpos , အရှည် , အမှု )
တေးရေး ဖေါ်ပြ
string1 လိုအပ်ပါတယ် နှိုင်းယှဉ်ခံရဖို့ပထမ ဦး ဆုံး string ကိုဖေါ်ပြသည်။
string2 လိုအပ်ပါတယ် နှိုင်းယှဉ်ခံရဖို့ဒုတိယ string ကိုဖေါ်ပြသည်။
StartPos လိုအပ်ပါတယ် string1 ကိုနှိုင်းယှဉ်စတင်ရန်ဘယ်မှာသတ်မှတ်သည်။ အကယ်. ၎င်းသည်အနှုတ်လက်ခဏာနံပါတ်ဖြစ်ပါက string ၏အဆုံးမှစတင်သည်။
အရှည် optional ကို။ string1 တွင်စာလုံးမည်မျှရှိသည်ကိုသတ်မှတ်သည် (ဇာတ်ကောင်အရေအတွက်) ။
သတ်တော

optional ကို။ ဖြစ်ရပ်မှန်အာရုံခံနိုင်မှုကိုလုပ်ဆောင်ရန်ရှိမရှိကိုဘော့လိုလိုတန်ဖိုး -

  • အတု - ပုံမှန်။ စာလုံးအကြီးအသေးသတိထားရမည်
  • စစ်မှန်သော - ကိစ္စမရှိခံစားမှု
သက်ဆိုင်သောဖင်ခှ်ရှင်းများ
  • String တွင်အသုံးပြုသောဇာတ်ကောင်များအကြောင်းသတင်းအချက်အလက်များကိုပြန်လည်ထူထောင်ခြင်း - byte တန်ဖိုးတစ်ခုစီ၏အကြိမ်အရေအတွက်ကိုရေတွက်သည်။ count_chars

    count_chars

    Stringတွင်အသုံးပြုသေ
  • ဖိုင်၏ sha1 hash တန်ဖိုးကိုတွက်ချက်ပါ sha1_file

    sha1_file

    ဖိုင်၏sha1hashတန်ဖို
  • ကြိုးအစားထိုးကြောင်း substrings substr_replace

    substr_replace

    ကြိုးအစားထိုးကြောင်း
  • htmlspecialchars () နှင့် htmlenties () ကိုအသုံးပြုပြီးနောက်ပြောင်းလဲခြင်းစားပွဲကိုပြန်ပို့သည် () get_html_translation_table

    get_html_translation_table

    htmlspecialchars()နှ
  • implode alias ကို alias join

    join

    implodealiasကိုalias
  • string ၏အဆုံးမှာ whitespace ဇာတ်ကောင် (သို့မဟုတ်အခြားဇာတ်ကောင်) ကိုဖျက်ပါ rtrim

    rtrim

    string၏အဆုံးမှာwhite
  • Binary Data ကို hexadecimal ကိုယ်စားပြုမှုသို့ပြောင်းပါ bin2hex

    bin2hex

    BinaryDataကိုhexadec
  • ယုတ္တိဖြစ်သောဟေဗြဲဘာသာကို Visual-Hebrew သို့ပြောင်းရန်နှင့်အသစ်များပြောင်းလဲပါ hebrevc

    hebrevc

    ယုတ္တိဖြစ်သောဟေဗြဲဘာ
လူကြိုက်များသော ဆောင်းပါးများ