Switch to full style
:read: Start PHP with us. Includes topics to help you in php
Post a reply

Echoing a String

Mon Oct 27, 2008 11:43 pm

Code:

<html>
<head>
<title>Echo Example</title>
</head>
<body>
<?php
     $string1
= "A.<br />\n";
     
$string2 = "B ";
     
$string3 = "Line 1
spans multiple lines.
Line3<br />"
;
   
     echo
"Start, ", $string2, $string1;
     echo(
"$string2$string1");
     echo(
"This string $string1");

     echo(
$string2 . $string1);
     echo(
$string3);
     echo
"Line 1.
lin 2!!<br />"
;
?>

<?=$string2,$string1?>

<?="output", " codemiles.com!", "<br />", ":-)", "<br />\n" ?>

<?="This string
spans multiple lines.
Even the newlines are output in the document source!<br />"
?>

</body>

</html>




Post a reply
  Related Posts  to : Echoing a String
 recursive string reversal- reverse string     -  
 check if string ends with specific sub-string in php     -  
 Splitting a String Based on a Found String     -  
 check if string start with a specific sub-string in PHP     -  
 String token for string split     -  
 Pad a string to a certain length with another string     -  
 String to sql.Date     -  
 what is string toString()     -  
 String Flatten (C++)     -  
 String Formatter     -  

Topic Tags

PHP Strings