简体   繁体   English

如何强制用户在MS Word中复制段落

[英]How to force users to copy paragraphs in MS Word

I am developing a system in PHP that is required to copy Word text and pasting them into the system. 我正在用PHP开发一个系统,该系统需要复制Word文本并将其粘贴到系统中。 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? 如何强迫他们从Word复制段落,或者如何在PHP中插入换行符?

I fixed this issue myself later on inserting simple if else condition to count the number of 我稍后在插入简单的if else条件来计算数量时解决了这个问题
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. $ string变量保存要处理的段落。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM