- 1
- 2
- 3
public static function correctTextForHTML($inSTR) {
return preg_replace("/\r\n|\n|\r/", "<br/>", $inSTR);
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+146
public static function correctTextForHTML($inSTR) {
return preg_replace("/\r\n|\n|\r/", "<br/>", $inSTR);
}
yasenhui 05.08.2011 07:49 # 0
Sers 05.08.2011 07:49 # 0
guest 05.08.2011 07:58 # −1
eth0 05.08.2011 10:38 # +1
warider 05.08.2011 14:20 # −1
Lure Of Chaos 05.08.2011 12:37 # 0
bugmenot 05.08.2011 16:33 # +1
inkanus-gray 07.08.2011 02:30 # 0
This section is non-normative.
This specification defines an abstract language for describing documents and applications, and some APIs for interacting with in-memory representations of resources that use this language.
The in-memory representation is known as "DOM HTML", or "the DOM" for short. This specification defines version 5 of DOM HTML, known as "DOM5 HTML".
There are various concrete syntaxes that can be used to transmit resources that use this abstract language, two of which are defined in this specification.
The first such concrete syntax is the HTML syntax. This is the format suggested for most authors. It is compatible with most legacy Web browsers. If a document is transmitted with an HTML MIME type, such as text/html, then it will be processed as an HTML document by Web browsers. This specification defines version 5 of the HTML syntax, known as "HTML5".
The second concrete syntax is the XHTML syntax, which is an application of XML. When a document is transmitted with an XML MIME type, such as application/xhtml+xml, then it is treated as an XML document by Web browsers, to be parsed by an XML processor. Authors are reminded that the processing for XML and HTML differs; in particular, even minor syntax errors will prevent a document labeled as XML from being rendered fully, whereas they would be ignored in the HTML syntax. This specification defines version 5 of the XHTML syntax, known as "XHTML5" (sic!!!111адинадинадин).
bugmenot 07.08.2011 16:00 # +1
gegMOPO4 06.08.2011 21:48 # 0
Lure Of Chaos 06.08.2011 21:51 # 0
RaZeR 06.08.2011 22:01 # 0
Lure Of Chaos 06.08.2011 22:10 # 0
RaZeR 06.08.2011 23:03 # 0
Lure Of Chaos 06.08.2011 23:05 # 0
paulkey 07.08.2011 01:28 # +1
gegMOPO4 07.08.2011 10:15 # 0
inkanus-gray 07.08.2011 22:54 # −1
Если не поставить пробел, то возникает неопределённость, к чему относится косая черта.
Sers 17.01.2021 00:30 # 0
guest3 17.01.2021 00:43 # 0