eduard Posted January 10, 2011 Share Posted January 10, 2011 <?php$text1="Hello World";$text2="What a nice day";echo $txt1."".$txt2;?>I don´t understand the latest ""? Link to comment Share on other sites More sharing options...
justsomeguy Posted January 10, 2011 Share Posted January 10, 2011 You don't need it, it doesn't do anything. Link to comment Share on other sites More sharing options...
eduard Posted January 10, 2011 Author Share Posted January 10, 2011 You don't need it, it doesn't do anything.Ok, thanks! Link to comment Share on other sites More sharing options...
thescientist Posted January 10, 2011 Share Posted January 10, 2011 <?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 More sharing options...
iwato Posted January 11, 2011 Share Posted January 11, 2011 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 More sharing options...
JDS419777586 Posted January 11, 2011 Share Posted January 11, 2011 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 More sharing options...
thescientist Posted January 11, 2011 Share Posted January 11, 2011 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.Roddyoh yeah!<?php$text1="Hello World";$text2="What a nice day";echo $text1 . ". " . $text2 . ".";?> Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.