This is probally a real simple question, but I am stuck. I have tried \r\n, and echo "<br/ >" and I am doing something wrong. $array_city[$i]['city'] = $row['city']. ' This is your city.'; Code (markup): The above code shows "CITY NAME This is your city.". What I would want it to do, is add an enter and then a new line of text. For example: CITY NAME This is your city. A great city indeed. How can I add a new enter in the above code?
<br /> makes a new line in the browser, for the user's view. \n makes a new line in the real data (not visible in the browsers normal view). Also note that \n needs to be placed between double quotes. It won't be parsed between single quotes.
So would that make my code? $array_city[$i]['city'] = $row['city']. ' This is your city.' '\n' 'A great city indeed; Code (markup):
$array_city[$i]['city'] = $row['city']. ' This is your city.' "\n" 'A great city indeed; Code (markup): So it needs to be the above code?
Almost. You have to place periods between string chunks to avoid parsing errors. (And you could use one single double quote string instead of three different ones) $array_city[$i]['city'] = $row['city']. " This is your city. \n A great city indeed"; PHP:
I did, but then I get 2 squares. Perhaps its important to mention that the output of the php is displayed in a pdf file.