- Code:
<?
$s = 'blogger';
echo <<<EOF
hai $s sekalian
EOF;
echo "hai $s sekalian";
echo 'hai '.$s.' sekalian';
?>
mana paling elok kita guna.Apa advantages guna <<<EOF
<?
$s = 'blogger';
echo <<<EOF
hai $s sekalian
EOF;
echo "hai $s sekalian";
echo 'hai '.$s.' sekalian';
?>
<?
$s = 'blogger';
echo <<<EOF
hai $s sekalian
saya bla ..bla bla
bla bla bla bla bla bla
bla bla bla bla bla bla
bla bla bla bla bla bla
bla bla bla bla bla bla
bla bla bla bla bla bla
EOF;
?>
<?
$s = 'blogger';
echo "hai $s sekalian";
echo "saya bla ..bla bla";
echo "bla bla bla bla bla bla";
echo "bla bla bla bla bla bla";
echo "bla bla bla bla bla bla";
echo "bla bla bla bla bla bla";
echo "bla bla bla bla bla bla";
?>
BasicCX wrote:Salam,
Kalau guna <<<EOF, kalau taip ayat panjang multiple line sangat digalakkan & mudah sebab tak perlu taip echo banyak kali, contoh:
- Code:
<?
$s = 'blogger';
echo <<<EOF
hai $s sekalian
saya bla ..bla bla
bla bla bla bla bla bla
bla bla bla bla bla bla
bla bla bla bla bla bla
bla bla bla bla bla bla
bla bla bla bla bla bla
EOF;
?>
tapi kalau guna echo:
- Code:
<?
$s = 'blogger';
echo "hai $s sekalian";
echo "saya bla ..bla bla";
echo "bla bla bla bla bla bla";
echo "bla bla bla bla bla bla";
echo "bla bla bla bla bla bla";
echo "bla bla bla bla bla bla";
echo "bla bla bla bla bla bla";
?>
<?php
$s = 'blogger';
echo "hai $s sekalian<br />saya bla ..bla bla<br />bla bla bla bla bla bla...";
?>