How should I perform multiple explode cutting and combination?

Source: Internet
Author: User
How do I perform multiple explode cutting and combination? $ a = 'youku $ tudou $ down'
$ B = 'Episode 1 $ abcd
Episode 1 $ abcd
Episode 2 $ abcd
Episode 3 $ abcd
Episode 4 $ abcd
Episode 5 $ abcd $ episode 1 $ abcd
Episode 1 $ abcd
Episode 2 $ abcd
Episode 3 $ abcd
Episode 4 $ abcd
Episode 5 $ abcd $ episode 1 $ abcd
Episode 1 $ abcd
Episode 2 $ abcd
Episode 3 $ abcd
Episode 4 $ abcd
Episode 5 $ abcd'



Yes $ split
Last $ or line feed segmentation
Finally, you need to get
  • Youku

  • Episode 1
    Second Set
    Episode 3
    Episode 4
    Episode 5

  • Tudou

  • Episode 1
    Second Set
    Episode 3
    Episode 4
    Episode 5

  • Down

  • Episode 1
    Second Set
    Episode 3
    Episode 4
    Episode 5


    Reply to discussion (solution)

    $ A = 'youku $ tudou $ down '; $ B = 'Episode 1 $ abcd episode 1 $ abcd episode 2 $ abcd episode 3 $ abcd episode 4 $ abcd episode 5 $ abcd $ episode 1 $ abcd episode 1 $ abcd episode 2 $ abcd episode 3 set $ abcd fourth set $ abcd fifth set $ abcd $ First set $ abcd first set $ abcd second set $ abcd third set $ abcd fourth set $ abcd fifth set $ abcd '; $ a = explode ('$', $ a); $ B = explode ('$', $ B ); foreach ($ a as $ I => $ r) {echo"
  • $ R
  • \ N "; foreach (explode (" \ n ", $ B [$ I]) as $ v) {$ t = explode ('$ ', trim ($ v); echo "$ t [0] \ n ";}}
  • Youku
  • First set first set second set third set fourth set fifth
  • Tudou
  • First set first set second set third set fourth set fifth
  • Down
  • First set first set second set third set fourth set fifth

    Hyperlink output error

    $ A = 'youku $ tudou $ down '; $ B = 'Episode 1 $ abcd episode 1 $ abcd episode 2 $ abcd episode 3 $ abcd episode 4 $ abcd episode 5 $ abcd $ episode 1 $ abcd episode 1 $ abcd episode 2 $ abcd episode 3 set $ abcd fourth set $ abcd fifth set $ abcd $ First set $ abcd first set $ abcd second set $ abcd third set $ abcd fourth set $ abcd fifth set $ abcd '; $ a = explode ('$', $ a); $ B = explode ('$', $ B ); foreach ($ a as $ I => $ r) {echo"
  • $ R
  • \ N "; foreach (explode (" \ n ", $ B [$ I]) as $ v) {$ t = explode ('$ ', trim ($ v); echo "$ t [0] \ n ";}}
  • Youku
  • First set first set second set third set fourth set fifth
  • Tudou
  • First set first set second set third set fourth set fifth
  • Down
  • First set first set second set third set fourth set fifth

    Wrong? What's wrong?
    I cannot always be born out of nothing, right?

    The hyperlink should be
    Youku
    Authorization 1.html
    1_2.html
    Routing 3.html
    """'

    Tudou
    2_1.html
    2_2.html
    2_3.html
    """''

    Down
    3_1.html
    3_2.html
    3_3.html
    """

    I don't know how to implement multiple loop outputs.

    Wrong? What's wrong?
    I cannot always be born out of nothing, right?

    The page should be real and should be filled in the abcd location of your data
    How can dynamic generation correspond to real pages?

    * _ *. Html
    (Here is the first batch of youku tudou down_(this is the unique id).html of each group.

    In this case, the link name is incorrect. Can the hyperlink array be counted from 1 instead of 0?


    $ A = 'youku $ tudou $ down '; $ B = 'Episode 1 $ abcd episode 1 $ abcd episode 2 $ abcd episode 3 $ abcd episode 4 $ abcd episode 5 $ abcd $ episode 6 $ abcd episode 7 $ abcd episode 8 $ ddddd ninth set $ abcd tenth set $ abcd 11th set $ abcd $ 12th set $ abcd 13th set $ abcd 14th set $ abcd 15th set $ abcd 16th set $ abcd 17th set $ efghijk '; $ a = explode ('$', $ a); $ B = explode ('$', $ B ); foreach ($ a as $ I => $ r) {echo"
  • $ R
  • \ N "; foreach (explode (" \ n ", $ B [$ I]) as $ v => $ lala) {$ t = explode ('$ ', trim ($ v); echo "$ t [0] \ n ";}}




    The page should be real and should be filled in the abcd location of your data
    How can dynamic generation correspond to real pages?

    $a = explode('$$$', $a);$b = explode('$$$', $b);foreach($a as $i=>$r) {  echo "
  • $r
  • \n"; foreach(explode("\n", $b[$i]) as $j=>$v) { $t = explode('$', trim($v)); printf("%s\n", $i+1, $j+1, $t[0]); }}
  • Youku
  • First set first set second set third set fourth set fifth
  • Tudou
  • First set first set second set third set fourth set fifth
  • Down
  • First set first set second set third set fourth set fifth


    But your data is supposed to be like this.
    $ A = comment'; $ a = explode ('$', $ a); $ B = explode ('$', $ B ); foreach ($ a as $ I => $ r) {echo"
  • $ R
  • \ N "; foreach (explode (" \ n ", $ B [$ I]) as $ v) {$ t = explode ('$ ', trim ($ v); echo "$ t [0] \ n ";}}
  • Youku
  • First set second set third set fourth set fifth set
  • Tudou
  • First set second set third set fourth set fifth set
  • Down
  • First set second set third set fourth set fifth set

    Thank you very much.

    In fact, this is the stream playback address. abcd is the stream playback address, which must be used separately.

    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.