redho home | products | services
Web Design Forums

Web Design Forums  


Web Hosting, Web Design, Software and Web Development Forums  
 FAQFAQ   MemberlistArchive  Log inLog in   RegisterRegister 
         

Adding a new line character in a string



 
Post new topic   Reply to topic    Web Design Forums -> PHP programming forum
View previous topic :: View next topic  
Author Message
Victor
Guest




Hello.
I'm trying to add a newline character in a string but it doesn work, please help

here is the code:

Code:
$var1= variable1;
$var2= variable2;
$message = $var1 . '\n\n results:' . $var2;


The result i get is:
Code:
variable1nn results:variable2



and i need this result:
Code:
variable1

results:variable2


Thank you in advance!!!
  Reply with quote


Coder
Guest




Try using dual quotes instead of one quote like this:
"\n" instead of '\n'

your example should look like:
Code:
$var1= variable1;
$var2= variable2;
$message = $var1 . "\n\n results:" . $var2;
  Reply with quote
Page 1 of 1
Post new topic   Reply to topic    Web Design Forums -> PHP programming forum


Dubai Forums - Expat Help | Vegan Chat | Java Programming | Free 3D tutorials and 3d textures | Paris Forum | EU Forum
Free Dubai Classifieds | Free London Classifieds | Jobs in London

High Quality, Custom 3d animation and Web Design solutions Royal Quality Web Hosting Services Vegetarian and Animal Rights news

Powered by phpBB © 2001, 2005 phpBB Group