To find two words of the same different phrase participle (to find algorithm ideas)

Source: Internet
Author: User
To find 2 words of the same different phrase participle (to find algorithm ideas)
Statement 1 "CSDN Forum is a very good forum"
Statement 2 "CSDN is a nice jar."

The following results are obtained after the same

Csdn=>2
Forum =>2
is a =>2
Very =>1
Nice =>2.
Jar =>1

------Solution--------------------
PHP Code
$a = ' Csdn Forum is a very good forum '; $b = ' csdn is a good jar ';p Rint_r (Sunday ($a, $b)); function Sunday ($a, $b) {//Check the character set of incoming strings Mb_interna L_encoding (mb_check_encoding ($a, ' utf-8 ')?    ' Utf-8 ': ' GBK ');    Split the incoming string into an array, mainly for the following code to write up a convenient point $t = Array (); for ($i =0; $i
  
   
     = count ($a)) break;            }elseif ($k) break;                    }//Check matching case if ($n-$i > 1) {if ($buf) {$r [] = $buf;                $buf = ";                } $r [] = Join ("', Array_slice ($a, $i, $n-$i));            $i = $n;        }else $buf. = $a [$i + +];        if ($BUF) $r [] = $buf; List ($b, $a) = Array ($a, $b);    Swap two sets of data, and again}while ($loop-); 
 Return Array_count_values ($R);} 
    
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.