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

nl2br

string တစ်ခု၏လိုင်းအသစ်များမတိုင်မီ HTML newline tag ကိုထည့်ပါ
အမည်:nl2br
အမျိုးအစား:ကြိုး
programming language:php
တစ်ကြောင်းဖြင့်အကျဉ်းချုပ်:string အတွက်လိုင်းအသစ်တစ်ခုချင်းစီမတိုင်မီ HTML အသစ်များထည့်ပါ။

နမူနာ

ဥပမာ 1

string တစ်ခုတွင်လိုင်းအသစ် (\ n) မတိုင်မီအသစ်တစ်ခုကိုထည့်ပါ။

 <span class="token php language-php"><span class="token delimiter important"><? PHP</span>
<span class="token keyword">Echo</span> <span class="token function">NL2BR</span> <span class="token punctuation">(</span> <span class="token string double-quoted-string">"တ ဦး တည်းလိုင်း။ \ nanothing line ။ "</span> <span class="token punctuation">);)</span> <span class="token punctuation">;</span>
<span class="token delimiter important">></span></span>

အထက်ပါကုဒ်၏ browser output ကို:

 လိုင်းတစ်ခု။
နောက်လိုင်း။

အထက်ပါကုဒ်၏ HTML input ကို (source code ကိုကြည့်ပါ):

 လိုင်းတစ်ခု။ <br />
နောက်လိုင်း။

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

ဥပမာ 2

XHTML Parameter သည် XHTML parameter ကိုအသုံးပြုခြင်းအားဖြင့်လိုင်းအသစ် (\ n) မတိုင်မီအသစ်တစ်ခုကိုထည့်ပါ။

 <span class="token php language-php"><span class="token delimiter important"><? PHP</span>
<span class="token keyword">Echo</span> <span class="token function">NL2BR</span> <span class="token punctuation">(</span> <span class="token string double-quoted-string">"လိုင်းတစ်ခု။ \ nannety line ။ "</span> <span class="token punctuation">,</span> <span class="token constant boolean">အတုအယောင်</span> <span class="token punctuation">)</span> <span class="token punctuation">;</span>
<span class="token delimiter important">></span></span>

အထက်ပါကုဒ်၏ browser output ကို:

 လိုင်းတစ်ခု။
နောက်လိုင်း။

အထက်ပါကုဒ်၏ HTML input ကို (source code ကိုကြည့်ပါ):

 လိုင်းတစ်ခု။ <br> <br>
နောက်လိုင်း။

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

သက်ဆိုင်သောဖင်ခှ်ရှင်းများ
  • strings များကို array သို့ပြောင်းပါ str_split

    str_split

    stringsများကိုarrayသ
  • ကျပန်းတစ် string ကိုနှောင့်အယှက် str_shuffle

    str_shuffle

    ကျပန်းတစ်stringကိုနှ
  • သေးငယ်တဲ့တုံးသို့ string ကိုခွဲ chunk_split

    chunk_split

    သေးငယ်တဲ့တုံးသို့str
  • အထူး HTML အဖွဲ့အစည်းများကိုပုံမှန်ဇာတ်ကောင်များသို့ပြန်သွားပါ htmlspecialchars_decode

    htmlspecialchars_decode

    အထူးHTMLအဖွဲ့အစည်းမျ
  • string တစ်ခုရဲ့ metaphone key ကိုတွက်ချက်ပါ metaphone

    metaphone

    stringတစ်ခုရဲ့metaph
  • Arrays သို့ CSV strings ကိုခွဲခြမ်းစိတ်ဖြာ str_getcsv

    str_getcsv

    Arraysသို့CSVstrings
  • Binary Safe နှိုင်းယှဉ်မှု string ကို (သတ်မှတ်ထားသောအရှည်ကို offset အနေအထားနှင့်နှိုင်းယှဉ်ပါ) substr_compare

    substr_compare

    BinarySafeနှိုင်းယှဉ
  • တစ်လမ်းသွား string ကို hash crypt

    crypt

    တစ်လမ်းသွားstringကို