PHP print() ပုံစံ

အကျိုးသတ္တု

ထုတ်လုပ်သို့ စကားလုံး ထည့်သွင်းလိမ့်မယ်:

<?php
print "I love Shanghai!";
?>

အမှုလုပ် ရှာဖွေ

အသုံးချက် နှင့် အပြုအရေး

print() ပုံစံ တစ်ခုခု သို့မဟုတ် အချို့ အရာများ ကို ထုတ်လုပ်သည်。

အစီရင်ခံစာ:print() ပုံစံ အမှုန်း တစ်ခု မဟုတ် မဟုတ် အမှုန်း တွင် အရွယ်အစား ကို အသုံးပြု လိမ့်မယ်。

hint:print() function than echo() slower.

syntax

print(strings)
parameters description
strings required. Send one or more strings to output.

technical details

return value: always returns 1.
PHP version: 4+

more examples

အမှုလုပ် 1

output string variable (str) value:

<?php
$str = "I love Shanghai!";
print $str;
?>

အမှုလုပ် ရှာဖွေ

အမှုလုပ် 2

output string variable ($str) value, including HTML tags:

<?php
$str = "I love Shanghai!";
print $str;
print "<br>What a nice day!";
?>

အမှုလုပ် ရှာဖွေ

အမှုလုပ် 3

two string variables:

<?php
$str1 = "I love Shanghai!";
$str2="What a nice day!";
print $str1 . " " . $str2;
?> 

အမှုလုပ် ရှာဖွေ

အမှုလုပ် 4

စကားအုပ် အတ္ထုပတ္တိ ထုတ်လုပ်

<?php
$age=array("Bill"=>"60");
print "Bill Gates is " . $age['Bill'] . " years old.";
?>

အမှုလုပ် ရှာဖွေ

အမှုလုပ် 5

ထုတ်လုပ် ဘာသာစကား

<?php
print "This text
spans multiple
lines.";
?> 

အမှုလုပ် ရှာဖွေ

အမှုလုပ် 6

ပုံစံ တခု နှင့် တခု အကွာအပြား။ ပုံစံ တခု မှာ သတင်း အမည် ကို ထုတ်လုပ် လိမ့်မည် မဟုတ် အတ္ထုပတ္တိကို ထုတ်လုပ် လိမ့်မည်မဟုတ်။

<?php
$color = "red";
print "Roses are $color";
print "<br>";
print 'Roses are $color';
?>

အမှုလုပ် ရှာဖွေ