如何强制用户在MS Word中复制段落(How to force users to copy paragraphs in MS Word)

编程入门 行业动态 更新时间:2024-10-27 08:28:08
如何强制用户在MS Word中复制段落(How to force users to copy paragraphs in MS Word)

我正在开发一个PHP系统,需要复制Word文本并将它们粘贴到系统中。 稍后,系统将替换段落并放置换行符以格式化输出。 但是,如果用户错过要复制的段落,则系统显示格式将被破坏并混乱。 如何强制他们从Word复制段落或如何在PHP中插入换行符?

I am developing a system in PHP that is required to copy Word text and pasting them into the system. Later on, the system replaces the paragraph and put the line breaks to format the output. However if the user misses the paragraph to copy then the system display formatting is broken and messed. How to force them to copy the paragraph from Word or how can I insert the line break in PHP?

最满意答案

我稍后自己修复了这个问题,插入简单的if else条件来计算数量 标签,并把额外的 如果计数小于所需的换行符,如下所示:

$br_count=substr_count($string, '<br>'); if($br_count<=5) { fwrite($fh,"<br>"); //Adds the extra line break here }

$ string变量保存要处理的段落。

I fixed this issue myself later on inserting simple if else condition to count the number of tags and put the extra if the count is less than required line breaks as follows:

$br_count=substr_count($string, '<br>'); if($br_count<=5) { fwrite($fh,"<br>"); //Adds the extra line break here }

$string variable holds the paragraph to process.

更多推荐

本文发布于:2023-08-07 15:22:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1464690.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:段落   用户   Word   MS   paragraphs

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!