Newbies dcooley Posted June 14, 2013 Newbies Posted June 14, 2013 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]
Newbies dcooley Posted June 14, 2013 Author Newbies Posted June 14, 2013 Figured it out. I used nl2br() and it works great. $table3_data .= nl2br($related_record->getField('HOH Info::DirectoryCombinedText'));
Elkpodemiami Posted June 14, 2013 Posted June 14, 2013 Could you provide a sample so I can try to understand you a bit better?
webko Posted June 16, 2013 Posted June 16, 2013 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
Recommended Posts
This topic is 4433 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now