Ben duruma bağlıdır düşünüyorum.
how many lines do you want to echo to the browser?
do the lines contain $variable values? $array values?
do you loop trough a dataset? etc etc.
Benim için, sadece çoğu zaman çizgileri yankı daha reable olduğunu.
<?php
if ( check($something) ) {
echo "Some variable is: $something<br/>\n";
} else {
echo "Some variable is something else!<br/>\n";
}
?>
daha okunabilir olabilir:
<?php
if ( check($something) ) {
?>
Some variable is: <?php echo $something; ?><br/>
<?php
} else {
?>
Some variable is something else!<br/>
<?php
}
?>
ve bazı IDE (ya da örneğin stackoverflow.com syntaxhighlighting) ile, hatta kullanmak daha okunabilir olabilir:
<?php
if ( check($something) ) {
echo 'Some variable is: '.$something."<br/>\n";
} else {
echo "Some variable is something else!<br/>\n";
}
?>
In summary:
PHP offers you a lot of options to send content to your client.
The 'best method' differs from case tot case.
most readable/maintainable ve use it consistently. olduğu yöntemini seçin