လက်ရှိတည်နေရာ: ပင်မစာမျက်နှာ> ဖန်ရှင်အမျိုးအစားများ> 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 ကိုပို့ပေးတဲ့တစ်ခုသို့မဟုတ်တစ်ခုထက်ပိုသောကြိုးများ။
သက်ဆိုင်သောဖင်ခှ်ရှင်းများ
  • သက်ဆိုင်သောအက္ခရာများအားလုံးကို HTML အဖွဲ့အစည်းများသို့ပြောင်းပါ htmlentities

    htmlentities

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

    str_getcsv

    Arraysသို့CSVstrings
  • Metacharacter အစုံလွတ်မြောက် quotemeta

    quotemeta

    Metacharacterအစုံလွတ
  • string ကိုစာလုံးအသေးပြောင်းပါ strtolower

    strtolower

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

    strtoupper

    stringကိုစာလုံးအကြီး
  • uuencode encoded string ကို decode convert_uudecode

    convert_uudecode

    uuencodeencodedstrin
  • output ကို format ချ string ကို printf

    printf

    outputကိုformatချstr
  • CRC32 polynomials string ကိုတွက်ချက်ပါ crc32

    crc32

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