June 14, 201312 yr Newbies I am wanting to show contact info for a family. The output I get is putting everything on one line. It is ignoring the carriage returns. My field in my database is a calculated field with carriage returns after certain info. See below for how I want the output to look. I am displaying the data in a table. This is the line where I call the getField function. $table3_data .= $related_record->getField('HOH Info::DirectoryCombinedText'); Output looks like: Parent1 Name & Parent2 Name Children: Child1, Child2, etc Address City, State Zip (h) (111)111-1111 Parent1 Name (111)111-1111 Parent2 (111)111-1111 Parent2 Name - [email protected] Parent2 Name - [email protected] What I want output to look like: Parent1 Name & Parent 2 Name Children: Child1 Name, Child2 Name,etc Address City, State, Zip (h) (111) 111-1111 Parent1 Name (111) 111-1111 Parent2 Name (111) 111-1111 Parent1 Name - [email protected] Parent2 Name - [email protected]
June 14, 201312 yr Author Newbies Figured it out. I used nl2br() and it works great. $table3_data .= nl2br($related_record->getField('HOH Info::DirectoryCombinedText'));
June 16, 201312 yr It's a standard php function to turn carriage returns and new lines into something that web browsers understand... nl2br($field) will take data data and make it data<br>data Which will then be shown in a browser as data data
Create an account or sign in to comment