473,396 Members | 2,147 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

XHTML in HTML 4

KeredDrahcir
426 256MB
I've got an HTML 4 page and I'm using textareas to gather the content to display on the page. I'm giving people the option to preserve the line breaks and using nl2br on the output to keep line breaks in.
The problem is that the line breaks are coming out as <br/> and that is XHTML. The W3C Validator says to use <br> and so 82 out of 84 warnings are due to this. Is there some way to get it to generate the empty br tags rather than self-closed ones?
Feb 6 '13 #1

✓ answered by Dormilich

see nl2br() for the correct usage.

4 1354
Dormilich
8,658 Expert Mod 8TB
use the second parameter that indicates XHTML: nl2br($str, false);
Feb 7 '13 #2
KeredDrahcir
426 256MB
Does that mean I put the second parameter as true it will include <br> tags as opposed to <br/> tags or is it the other way round?
Feb 18 '13 #3
Dormilich
8,658 Expert Mod 8TB
see nl2br() for the correct usage.
Feb 18 '13 #4
KeredDrahcir
426 256MB
Thanks. That's great.
Feb 18 '13 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Captain Nemo | last post by:
Hi I'm essentially a back-end programmer so I don't know very much about Dreamweaver. However, I work with web-designers who are keen for me to write my pages using Dreamweaver templates. ...
3
by: Spam Survivor | last post by:
Hi folks: I'm assuming someone's been down this path before: we want to provide our users with a tool integrated into our content-management website that will allow them to validate their html &...
1
by: Gordon - Adelphia | last post by:
I have a question regarding xhtml. Why, why, why does the ELEMENT <body> allow “unblocked” text. HTML does not (though, most browsers will render). Xhtml (transitional) however allows text nodes...
41
by: CMAR | last post by:
What are the pluses and minuses of constructing and validating between XHTML Transitional vs. HTLM 4.01 Strict Thanks, CMA
15
by: Jake Barnes | last post by:
I'm trying to learn AJAX so tonight I sat down and came up with a little toy that I can do tests with. You can see it here: http://www.publicdomainsoftware.org/ajaxExperiment.htm I've got...
1
by: Lore Leunoeg | last post by:
Hello Can I parse an XHTML Document with XPath? I tried the following expressions with the following XHTML Document with n o result: Removing the doctype and the namespace (xmlns) statemens...
11
by: Michael Powe | last post by:
How can I make an XHTML-compliant form of an expression in this format: document.write("<scr"+"ipt type='text/javascript' src='path/to/file.js'>"+"</scr"+"ipt>"); this turns out to be a...
5
by: sniper | last post by:
hi ; i have this small code that consist in taking the name of the user and writing it in the same form as an output.the name is relative to /data/valid/string1 In my Js code i want to access the...
3
by: Nik | last post by:
I have been trying base my site on the Ruthsarian Lab's layout at http://webhost.bridgew.edu/etribou/layouts/skidoo/demos/tweak_01.html This design is in xhtml, whereas I would prefer to have my...
3
by: dantohester | last post by:
Hi there, I have the following situation: I want to create an XML document that contains 2 parts: a) a XHTML part (it can be either version 1.0 or 1.1 ) b) a non XHTML part that contains some...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.