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

strchr

strstr ၏ alias ကို
အမည်:strchr
အမျိုးအစား:ကြိုး
programming language:php
တစ်ကြောင်းဖြင့်အကျဉ်းချုပ်:အခြား string တစ်ခုအတွက် string ကို၏ပထမ ဦး ဆုံးဖြစ်ပျက်မှုကိုရှာပါ။ (strstrion များအတွက် alias) ။ )

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

strchr() function ကိုအခြား string တစ်ခုအတွက်ပထမ ဦး ဆုံးဖြစ်ပျက်ရန်ရှာဖွေခြင်း။

ဒီ function ဟာ strstr() function ကိုအတွက် alias ကိုဖြစ်ပါတယ်။

မှတ်ချက် - ဒီ function က binary ဘေးကင်းလုံခြုံသည်။

မှတ်ချက် - ဒီ function ကစာလုံးအကြီးအသေးအရေးပါသည်။ ဖြစ်ရပ်မှန်အာရုံမခံစားနိုင်သောရှာဖွေမှုများအနေဖြင့် stristr() function ကိုသုံးပါ။

နမူနာ

ဥပမာ 1

"Hello World" တွင် "World" ၏ပထမအကြိမ်ဖြစ်ပျက်မှုကိုရှာပါ။ နှင့်ကျန် string ကိုပြန်ပို့ပါ:

 <? PHP
Echo strchr ( "Hello World!" , "World" ) ,
>

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

ဥပမာ 2

"O" ၏ ASCII တန်ဖိုးကို ASCII တန်ဖိုးဖြင့်ရှာဖွေပြီးကျန် string ကိုပြန်ပို့ပါ။

 <? PHP
ECHO strchr ( "Hello World!" , 111 ) ;
>

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

ဥပမာ 3

"World" ၏ပထမ ဦး ဆုံးဖြစ်ပျက်မှုမတိုင်မီ string ကိုအပိုင်းကိုပြန်သွား::

 <? PHP
echo strchr ( "Hello World!" , "World" , True ) ,
>

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

သဒ္ဒါ

 strchr ( string , search , option_search ) ;
တေးရေး ဖေါ်ပြ
ကြိုး လိုအပ်ပါတယ် ရှာဖွေလျက်ရှိသော string ကိုဖေါ်ပြသည်။
ရှာဖေှခြင်း

လိုအပ်ပါတယ် ရှာဖွေရေး string ကိုဖေါ်ပြသည်။

အကယ်. parameter သည်နံပါတ်တစ်ခုဆိုပါကနံပါတ်နှင့်သက်ဆိုင်သော ASCII တန်ဖိုးနှင့်ကိုက်ညီသောစာလုံးများကိုရှာဖွေပါ။

_search

optional ကို။ ပုံမှန်တန်ဖိုးသည် "မှားယွင်းသော" ၏ boolean တန်ဖိုးဖြစ်သည်။

အကယ်. "True" ကိုသတ်မှတ်ပါက ရှာဖွေမှု parameter သည်ပထမ ဦး ဆုံးပေါ်လာသည်။

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

    rtrim

    string၏အဆုံးမှာwhite
  • ကျပန်းတစ် string ကိုနှောင့်အယှက် str_shuffle

    str_shuffle

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

    stripos

    Stringပထမဦးဆုံးပေါ်လ
  • string ကိုပေးထားသော substring နှင့်အတူအဆုံးသတ် str_ends_with

    str_ends_with

    stringကိုပေးထားသောsu
  • နှစ်ခု strings အကြားတည်းဖြတ်အကွာအဝေးတွက်ချက် levenshtein

    levenshtein

    နှစ်ခုstringsအကြားတည
  • string ကိုစာလုံးအသေးပြောင်းပါ strtolower

    strtolower

    stringကိုစာလုံးအသေးပ
  • ဒီဂျစ်တယ် format အချက်အလက်ကိုရယူပါ localeconv

    localeconv

    ဒီဂျစ်တယ်formatအချက်
  • တစ် ဦး 8-bit string ကိုကိုးကားနှင့်အတူပုံနှိပ်ထုတ်ဝေသီ string ကိုပြောင်းပါ quoted_printable_decode

    quoted_printable_decode

    တစ်ဦး8-bitstringကိုက
လူကြိုက်များသော ဆောင်းပါးများ