How to add a space in php

+1 MAK Leung · May 23, 2015
Hi,
  Is there anyone would help me how to write code to display this in php ?
        A
     AAA
   AAAAA

Thanks
MAK

Post a Reply

Replies

Oldest  Newest  Rating
0 Oussama Fahchouch · May 23, 2015
<?php
echo nl2br("One line.\nAnother line.");
?>

The browser output of the code above will be:
One line.
Another line.

So ur problem is solved with the code: \n.
Write \n when u want to paste an enter in your program.

Source: http://www.w3schools.com/php/func_string_nl2br.asp
  • 1

PHP

107,202 followers
About

Server-side, HTML embedded scripting language used to create dynamic Web pages.

Links
Moderators