Jump to content

"?


eduard

Recommended Posts

<?php$text1="Hello World";$text2="What a nice day";echo $txt1."".$txt2;?>I don´t understand the latest ""?
it's putting an empty string in between the variables, so the output would beHello WorldWhat a nice dayyou could do something like this, if you were handling for formatting. (adding punctuation and spacing)
$text1="Hello World";$text2="What a nice day";echo $txt1 . ".  " . $txt2 . ".";

outputs: Hello World. What a nice day.

Link to comment
Share on other sites

it's putting an empty string in between the variables, so the output would beHello WorldWhat a nice dayyou could do something like this, if you were handling for formatting. (adding punctuation and spacing)
$text1="Hello World";$text2="What a nice day";echo $txt1 . ".  " . $txt2 . ".";

outputs: Hello World. What a nice day.

Just make sure that you use the same variable names from one command line to the next; else, your punctuation will have little useful meaning.Roddy
Link to comment
Share on other sites

Just make sure that you use the same variable names from one command line to the next; else, your punctuation will have little useful meaning.Roddy
<? PHP$text1="Hello World";$text2="What a nice day";echo $txt1 . ".  " . $txt2 . ".";?>

I agree. The code in the above example looks cleaner than "" .

Link to comment
Share on other sites

Just make sure that you use the same variable names from one command line to the next; else, your punctuation will have little useful meaning.Roddy
oh yeah!
<?php$text1="Hello World";$text2="What a nice day";echo $text1 . ".  " . $text2 . ".";?>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...