简体   繁体   中英

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. 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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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