项目要求对编辑中添加的内容可以进行分页,所以把Kindeditor中默认的分页插入字符变成了{{page}}。项目开发语言是PHP
例如content的htmlt代码如下
<p style="text-indent:2em;"> 翰林世家一期即将交房,业主们对自己的新家充满了期待。9月20日下午2点翰林学苑爱之家课堂,将诚邀室内资深设计师、家居配饰大师,围绕个性化家居初体验、家居文化等方面,在翰林世家售楼部为业主提供专享服务,希望能为业主的家装提供一些专业的帮助。 </p> <p style="text-indent:2em;"> <strong>2014家居流行趋势解码</strong> </p> <p style="text-indent:2em;"> 智能化的卫浴,异彩纷呈的合成材料,环保、原生态的地板,崇尚自然的天然涂料……舒适的生活可以让人身心放松,现在都市生活让人们对家居环境的要求已经不仅仅是舒适、温馨和实用,而是一种对美好家居生活的向往、对高质量家居品位的不懈追求。如同时尚前沿的巴黎时装秀,今年的家居行业也迎来了新的流行趋势:是潮流达人们们偏爱的新东方主义、流行炫色,还是原色原味、清新自然的原木搭配?翰林世家特别邀请了名家解码家居流行密码,为业主带来2014年的流行元素。 </p> <p style="text-align:center;"> <img src="/static/imghwm/default1.png" data-src="/static/img/blank.gif" class="lazy" data-original="http://hzzxw.b0.upaiyun.com/uploads/20140918/541a528890388.jpg" style="max-width:90%" style="max-width:90%" alt="" /> </p> <p style="text-align:left;text-indent:2em;"> <strong></strong><strong>2014翰林世家交房户型设计</strong> </p> <p style="text-align:left;text-indent:2em;"> 二人世界、浪漫满屋,90方现代简约三口之家,奢华舒适、高端典雅四世同堂;中式风格、地中海风格、欧式风格、美式风格……本期爱之家课堂是翰林世家针对即将交房的户型进行的专场设计,精英设计师以平面图、效果图结合实景作品等形式展示,多种设计风格、多个方案帮您找到满意的装修方案。 </p> <p style="text-align:left;text-indent:2em;"> {{page}} </p> <p style="text-align:left;text-indent:2em;"> <strong>2014超级空间整理术</strong> </p> <p style="text-align:left;text-indent:2em;"> <br /> </p> <p style="text-align:left;text-indent:2em;"> 超级空间整理,顺势而动。床下的大抽屉可以简单收纳,墙壁上的搁板放置书本、唱片,让卧室成为丰富的娱乐放松空间;阳台变花房,环保又美观……对于空间的整理、规划技术,设计师们可是内行,而资深设计更是深得其法。在本次翰林学苑爱之家家装课堂上,资深设计师对翰林世家的业主居住空间作出规划,设计出魔变空间。 </p>
我采用PHP的explode分离后发现,那个分页特殊的字符串前后是有html标记,会导致html缺少指定的结束符号、或者开始符号。
对于正则本人也只是略懂,哪位大牛能帮忙给个解决方案不,或者能匹配套{{page}}当前和几位的html标记是更好了。
回复内容:
项目要求对编辑中添加的内容可以进行分页,所以把Kindeditor中默认的分页插入字符变成了{{page}}。项目开发语言是PHP
例如content的htmlt代码如下
<p style="text-indent:2em;"> 翰林世家一期即将交房,业主们对自己的新家充满了期待。9月20日下午2点翰林学苑爱之家课堂,将诚邀室内资深设计师、家居配饰大师,围绕个性化家居初体验、家居文化等方面,在翰林世家售楼部为业主提供专享服务,希望能为业主的家装提供一些专业的帮助。 </p> <p style="text-indent:2em;"> <strong>2014家居流行趋势解码</strong> </p> <p style="text-indent:2em;"> 智能化的卫浴,异彩纷呈的合成材料,环保、原生态的地板,崇尚自然的天然涂料……舒适的生活可以让人身心放松,现在都市生活让人们对家居环境的要求已经不仅仅是舒适、温馨和实用,而是一种对美好家居生活的向往、对高质量家居品位的不懈追求。如同时尚前沿的巴黎时装秀,今年的家居行业也迎来了新的流行趋势:是潮流达人们们偏爱的新东方主义、流行炫色,还是原色原味、清新自然的原木搭配?翰林世家特别邀请了名家解码家居流行密码,为业主带来2014年的流行元素。 </p> <p style="text-align:center;"> <img src="/static/imghwm/default1.png" data-src="/static/img/blank.gif" class="lazy" data-original="http://hzzxw.b0.upaiyun.com/uploads/20140918/541a528890388.jpg" style="max-width:90%" style="max-width:90%" alt="" /> </p> <p style="text-align:left;text-indent:2em;"> <strong></strong><strong>2014翰林世家交房户型设计</strong> </p> <p style="text-align:left;text-indent:2em;"> 二人世界、浪漫满屋,90方现代简约三口之家,奢华舒适、高端典雅四世同堂;中式风格、地中海风格、欧式风格、美式风格……本期爱之家课堂是翰林世家针对即将交房的户型进行的专场设计,精英设计师以平面图、效果图结合实景作品等形式展示,多种设计风格、多个方案帮您找到满意的装修方案。 </p> <p style="text-align:left;text-indent:2em;"> {{page}} </p> <p style="text-align:left;text-indent:2em;"> <strong>2014超级空间整理术</strong> </p> <p style="text-align:left;text-indent:2em;"> <br /> </p> <p style="text-align:left;text-indent:2em;"> 超级空间整理,顺势而动。床下的大抽屉可以简单收纳,墙壁上的搁板放置书本、唱片,让卧室成为丰富的娱乐放松空间;阳台变花房,环保又美观……对于空间的整理、规划技术,设计师们可是内行,而资深设计更是深得其法。在本次翰林学苑爱之家家装课堂上,资深设计师对翰林世家的业主居住空间作出规划,设计出魔变空间。 </p>
我采用PHP的explode分离后发现,那个分页特殊的字符串前后是有html标记,会导致html缺少指定的结束符号、或者开始符号。
对于正则本人也只是略懂,哪位大牛能帮忙给个解决方案不,或者能匹配套{{page}}当前和几位的html标记是更好了。
给你一个自动补全的php代码:
/** * close all open xhtml tags at the end of the string * @param string $html * @return string * @author Milian Wolff */ function closetags($html) { #put all opened tags into an array preg_match_all('#<([a-z]+)(?: .*)?(?<![/|/ ])>#iU', $html, $result); $openedtags = $result[1]; #put all closed tags into an array preg_match_all('#</([a-z]+)>#iU', $html, $result); $closedtags = $result[1]; $len_opened = count($openedtags); # all tags are closed if (count($closedtags) == $len_opened) { return $html; } $openedtags = array_reverse($openedtags); # close tags for ($i=0; $i < $len_opened; $i++) { if (!in_array($openedtags[$i], $closedtags)){ $html .= '</'.$openedtags[$i].'>'; } else { unset($closedtags[array_search($openedtags[$i], $closedtags)]); } } return $html; }
使用这个函数就可以将为未关闭的html标签补全,这样就可以避免显示的问题了~

What’s still popular is the ease of use, flexibility and a strong ecosystem. 1) Ease of use and simple syntax make it the first choice for beginners. 2) Closely integrated with web development, excellent interaction with HTTP requests and database. 3) The huge ecosystem provides a wealth of tools and libraries. 4) Active community and open source nature adapts them to new needs and technology trends.

PHP and Python are both high-level programming languages that are widely used in web development, data processing and automation tasks. 1.PHP is often used to build dynamic websites and content management systems, while Python is often used to build web frameworks and data science. 2.PHP uses echo to output content, Python uses print. 3. Both support object-oriented programming, but the syntax and keywords are different. 4. PHP supports weak type conversion, while Python is more stringent. 5. PHP performance optimization includes using OPcache and asynchronous programming, while Python uses cProfile and asynchronous programming.

PHP is mainly procedural programming, but also supports object-oriented programming (OOP); Python supports a variety of paradigms, including OOP, functional and procedural programming. PHP is suitable for web development, and Python is suitable for a variety of applications such as data analysis and machine learning.

PHP originated in 1994 and was developed by RasmusLerdorf. It was originally used to track website visitors and gradually evolved into a server-side scripting language and was widely used in web development. Python was developed by Guidovan Rossum in the late 1980s and was first released in 1991. It emphasizes code readability and simplicity, and is suitable for scientific computing, data analysis and other fields.

PHP is suitable for web development and rapid prototyping, and Python is suitable for data science and machine learning. 1.PHP is used for dynamic web development, with simple syntax and suitable for rapid development. 2. Python has concise syntax, is suitable for multiple fields, and has a strong library ecosystem.

PHP remains important in the modernization process because it supports a large number of websites and applications and adapts to development needs through frameworks. 1.PHP7 improves performance and introduces new features. 2. Modern frameworks such as Laravel, Symfony and CodeIgniter simplify development and improve code quality. 3. Performance optimization and best practices further improve application efficiency.

PHPhassignificantlyimpactedwebdevelopmentandextendsbeyondit.1)ItpowersmajorplatformslikeWordPressandexcelsindatabaseinteractions.2)PHP'sadaptabilityallowsittoscaleforlargeapplicationsusingframeworkslikeLaravel.3)Beyondweb,PHPisusedincommand-linescrip

PHP type prompts to improve code quality and readability. 1) Scalar type tips: Since PHP7.0, basic data types are allowed to be specified in function parameters, such as int, float, etc. 2) Return type prompt: Ensure the consistency of the function return value type. 3) Union type prompt: Since PHP8.0, multiple types are allowed to be specified in function parameters or return values. 4) Nullable type prompt: Allows to include null values and handle functions that may return null values.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

SublimeText3 Linux new version
SublimeText3 Linux latest version

SublimeText3 Chinese version
Chinese version, very easy to use

Atom editor mac version download
The most popular open source editor

SublimeText3 Mac version
God-level code editing software (SublimeText3)