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

print

တစ် string ကို output ကို
အမည်:print
အမျိုးအစား:ကြိုး
programming language:php
တစ်ကြောင်းဖြင့်အကျဉ်းချုပ်:output ကိုတစ်ခုသို့မဟုတ်တစ်ခုထက်ပိုသောကြိုး။

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

print() function ကိုတစ်ခုသို့မဟုတ်တစ်ခုထက်ပိုသောကြိုးများထုတ်ယူခြင်း။

မှတ်ချက် - print() function သည် function တစ်ခုမဟုတ်ပါ, ထို့ကြောင့်၎င်းသည်ကွင်းရံကိုသုံးစရာမလိုပါ။

ထိပ်ဖျား: print() function ကို echo() ထက်အနည်းငယ်နှေးကွေးသည်။

နမူနာ

ဥပမာ 1

စာသားကို output ကိုရေးပါ။

 <? PHP
ပုံနှိပ် "ငါရှန်ဟိုင်းကိုချစ်!" ;
>

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

ဥပမာ 2

string variable ၏တန်ဖိုးကို ($ str) ၏တန်ဖိုးကို output:

 <? PHP
$ str = "ငါရှန်ဟိုင်းကိုချစ်!" ;
$ str ကိုပုံနှိပ် ;
>

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

ဥပမာ 3

HTML tags များပါ 0 င်သည့် string variable ($ str) ၏တန်ဖိုးကိုထုတ်ပေးသည်။

 <? PHP
$ str = "ငါရှန်ဟိုင်းကိုချစ်!" ;
$ str ကိုပုံနှိပ် ;
ပုံနှိပ် "<br> ဘာကောင်းတဲ့နေ့ပဲ!" ;
>

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

ဥပမာ 4

string နှစ်ခုကို concatenate:

 <? PHP
$ str1 = "ငါရှန်ဟိုင်းကိုချစ်!" ;
$ str2 = "ကောင်းတဲ့နေ့ပဲ!" ;
$ str1 ပုံနှိပ် ။ "" ။ $ str2 ;
> 

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

ဥပမာ 5

output array တန်ဖိုး:

 <? PHP
$ age = array ( "Bill" => "60" ) ;
ပုံနှိပ် "Bill Gates သည် " $ အသက်အရွယ် [ 'Bill' ] ။ "နှစ်တွေ။ " ;
>

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

ဥပမာ 6

output စာသား:

 <? PHP
ပုံနှိပ် "ဒီစာသား
မျိုးစုံ
လိုင်းများ။ " ;
> 

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

ဥပမာ 7

တစ်ခုတည်းကိုးကားနှင့်နှစ်ဆကိုးကားအကြားခြားနားချက်။ တစ်ခုတည်းကိုးကားတန်ဖိုးမရှိတဲ့ variable name name ကိုထုတ်ပေးလိမ့်မည်။

 <? PHP
$ အရောင် = "အနီရောင်" ,
"နှင်းဆီပန်း $ အရောင် " ပုံနှိပ် ။
ပုံနှိပ် "<br> <br>" ;
'နှင်းဆီပန်း $ အရောင်' ပုံနှိပ်ခြင်း ,
>

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

သဒ္ဒါ

 ပုံနှိပ်ခြင်း ( ကြိုးများ )
တေးရေး ဖေါ်ပြ
ကြိုး လိုအပ်ပါတယ် output ကိုပို့ပေးတဲ့တစ်ခုသို့မဟုတ်တစ်ခုထက်ပိုသောကြိုးများ။
သက်ဆိုင်သောဖင်ခှ်ရှင်းများ
  • Binary Safe Safe-Assessive String နှိုင်းယှဉ်ခြင်း strcasecmp

    strcasecmp

    BinarySafeSafe-Asses
  • တစ် string ကို output ကို print

    print

    တစ်stringကိုoutputကိ
  • string ကိုစာလုံးအကြီးသို့ပြောင်းပါ strtoupper

    strtoupper

    stringကိုစာလုံးအကြီး
  • စာလုံးကြီး၏ပထမ ဦး ဆုံးအက်ခရာကိုသတ်မှတ်ပါ ucfirst

    ucfirst

    စာလုံးကြီး၏ပထမဦးဆုံး
  • string ကိုပြန်လုပ်ပါ str_repeat

    str_repeat

    stringကိုပြန်လုပ်ပါ
  • addcslashes သုံး. string ကိုဆန့်ကျင်ရေးဆန့်ကျင်ရေးဆန့်ကျင်ရေး stripcslashes

    stripcslashes

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

    substr_compare

    BinarySafeနှိုင်းယှဉ
  • uuencode encoded string ကို decode convert_uudecode

    convert_uudecode

    uuencodeencodedstrin
လူကြိုက်များသော ဆောင်းပါးများ