0

I want to add new line to an existing string I tried this way

$filename = 'popups-'.$jsonData['name'].'.js';
$text = $jsonData['text'].'\n';

However I get \n directly append in the string instead of a new line What am I doing wrong here??

Alive to die - Anant
  • 70,531
  • 10
  • 51
  • 98

1 Answers1

4

you should use double quotes for this

$filename = 'popups-'.$jsonData['name'].'.js';
$text = $jsonData['text']."\n";

http://php.net/manual/en/language.types.string.php

MakeLoveNotWar
  • 956
  • 9
  • 25