|
PHP. View variables, operations with them, constants, PART 3 |
Text with comments <h3>tekstas su komentaru <? // echo $c = "php komentaras "; ?> matomas tekstas</h3> <h3>tekstas su komentaru <? /* echo $c = "php komentaras"; ?> matomas tekstas</h1><I>paverstas tekstas</I></h3><? */ ?>Printing variables <? $a = "10m10"; $b = "tekstas"; echo "<br> operacijos <br>"; echo $a + $b; ?><BR><? echo $a + true ; ?><BR><? echo $a + false ;?><BR><? echo $a . false ;?><BR><? echo "tekstas". $a . false ; ?> <?= $SERVER['PHP_SELF'] ; ?><br> <? print $SERVER['PHP_SELF'] ;
echo <<<END <br>This uses the "here document" syntax to output multiple lines with $variable interpolation. Note that the here document terminator must appear on a line with just a semicolon. no extra whitespace!<br><hr> END;
echo 'This ', 'string ', 'was ', 'made ', 'with multiple parameters.', chr(10);
echo 'This ' . 'string ' . 'was ' . 'made ' . 'with concatenation.' . "\n";
echo "2 + 2 = " . 2+2; // This will print 4 echo "2 + 2 = " , 2+2; // This will print 2+2 = 4 echo "2 + 2 = " . (2+2); // This will print 2+2 = 4
?>
|