I have an array passed to a page via session:
Array(
[0] => Somewhere
Belfast
[1] => New York
)
The data is then gathered in a JS variable:
var json_university_addresses = '<?php echo (Session::get('university_address'))?>';
Before it is then split into a JS array:
var aUniversityAddresses = json_university_addresses.split(',');
The problem I am getting is the line break between 'somewhere' and 'belfast'. This is causing the page to fail.
Is there anything I can do with the data either side to make this easier? I want to display the line break to the user.
Thanks