0

这就是我从数据库中提取数据以及当“异常”出现时我想在新行中显示时呈现数据的内容。但我想以适当的方式在单个 sring 中显示它们

The requirements of this chapter apply to the following: (1) New buildings or portions thereof used as health care occupancies (see 1.4.1) (2) Additions made to, or used as, a health care occupancy (see 4.6.6 and 18.1.1.4) Exception: The requirement of 18.1.1.1.1 shall not apply to additions classified as occupancies other than health care that are separated from the health care occupancy in accordance with 18.1.2.1(2) and conform to the requirements for the specific occupancy in accordance with Chapters 12 through 17 and Chapters 20 through 42, as appropriate.(3) Alterations, modernizations, or renovations of existing health care occupancies (see 4.6.7 and 18.1.1.4) (4) Existing buildings or portions thereof upon change of occupancy to a health care occupancy (see 4.6.11) Exception*: Facilities where the authority having jurisdiction has determined equivalent safety has been provided in accordance with Section 1.5.

我想按以下顺序动态显示

本章的要求适用于以下情况:

(1) New buildings or portions thereof used as health care occupancies (see 1.4.1)

 (2) Additions made to, or used as, a health care occupancy (see 4.6.6 and 18.1.1.4) 

Exception: The requirement of 18.1.1.1.1 shall not apply to additions classified as occupancies other than health care that are separated from the health care occupancy in accordance with 18.1.2.1(2) and conform to the requirements for the specific occupancy in accordance with Chapters 12 through 17 and Chapters 20 through 42, as appropriate.

(3) Alterations, modernizations, or renovations of existing health care occupancies (see 4.6.7 and 18.1.1.4) 

(4) Existing buildings or portions thereof upon change of occupancy to a health care occupancy (see 4.6.11) Exception*: Facilities where the authority having jurisdiction has determined equivalent safety has been provided in accordance with Section 1.5.

虽然我在 javascript 中执行此操作。我在 section_data.title 中获得此内容的位置。我怎么能做到这一点。

4

2 回答 2

0

我有一种感觉,你的换行符不在 html 中。在将其编码为 JSON 之前尝试str_replace('\n', '<br>', $queryResultString);在您的 PHP 中使用(将 $queryResultString 替换为您通过 JSON 发送的任何字符串)。

让我知道这是否有效,或者我们可以尝试其他方法。

于 2013-04-09T05:49:10.657 回答
0

使用JavaScript方法“String[] split(String regex)”将字符串按照正则表达式拆分并存储在数组中。然后可以添加断线标签对其进行格式化。

于 2013-04-09T05:52:14.637 回答