本帖最后由 lovepzt 于 2015-01-09 19:16:09 编辑

解决方案 »

  1.   

    $a = 'youku$$$tudou$$$down';
    $b='第一集$abcd
    第一集$abcd
    第二集$abcd
    第三集$abcd
    第四集$abcd
    第五集$abcd$$$第一集$abcd
    第一集$abcd
    第二集$abcd
    第三集$abcd
    第四集$abcd
    第五集$abcd$$$第一集$abcd
    第一集$abcd
    第二集$abcd
    第三集$abcd
    第四集$abcd
    第五集$abcd';$a = explode('$$$', $a);
    $b = explode('$$$', $b);
    foreach($a as $i=>$r) {
      echo "<li>$r</li>\n";
      foreach(explode("\n", $b[$i]) as $v) {
        $t = explode('$', trim($v));
        echo "<a href='$t[1]' target='_top'>$t[0]</a>\n";
      }
    }
    <li>youku</li>
    <a href='abcd' target='_top'>第一集</a>
    <a href='abcd' target='_top'>第一集</a>
    <a href='abcd' target='_top'>第二集</a>
    <a href='abcd' target='_top'>第三集</a>
    <a href='abcd' target='_top'>第四集</a>
    <a href='abcd' target='_top'>第五集</a>
    <li>tudou</li>
    <a href='abcd' target='_top'>第一集</a>
    <a href='abcd' target='_top'>第一集</a>
    <a href='abcd' target='_top'>第二集</a>
    <a href='abcd' target='_top'>第三集</a>
    <a href='abcd' target='_top'>第四集</a>
    <a href='abcd' target='_top'>第五集</a>
    <li>down</li>
    <a href='abcd' target='_top'>第一集</a>
    <a href='abcd' target='_top'>第一集</a>
    <a href='abcd' target='_top'>第二集</a>
    <a href='abcd' target='_top'>第三集</a>
    <a href='abcd' target='_top'>第四集</a>
    <a href='abcd' target='_top'>第五集</a>
      

  2.   

    超链接应该是
    youku
    1_1.html
    1_2.html
    1_3.html
    ``````````tudou
    2_1.html
    2_2.html
    2_3.html
    ```````````down
    3_1.html
    3_2.html
    3_3.html
    `````````多个循环输出真不知道要怎么搞
      

  3.   

    页面应是真实存在的,应填写在你数据的 abcd 位置
    动态生成的怎么能和真实页面对应起来?
      

  4.   

    *_*.html
    (这里是youku tudou down第次的数组)_(这里是各组又重新对应的ID).html改成这样的话,就链接名称错了,超链接的数组能不能从1开始算起,不从0算起?
    $a = 'youku$$$tudou$$$down';
    $b='第一集$abcd
    第一集$abcd
    第二集$abcd
    第三集$abcd
    第四集$abcd
    第五集$abcd$$$第六集$abcd
    第七集$abcd
    第八集$ddddd
    第九集$abcd
    第十集$abcd
    第十一集$abcd$$$第十二集$abcd
    第十三集$abcd
    第十四集$abcd
    第十五集$abcd
    第十六集$abcd
    第十七集$efghijk';
    $a = explode('$$$', $a);
    $b = explode('$$$', $b);
    foreach($a as $i=>$r) {
      echo "<li>$r</li>\n";
      foreach(explode("\n", $b[$i]) as $v=>$lala) {
        $t = explode('$', trim($v));    echo "<a href='".$i."_".$t[0].".html' target='_top'>$t[0]</a>\n";
      }
    }
      

  5.   

    $a = explode('$$$', $a);
    $b = explode('$$$', $b);
    foreach($a as $i=>$r) {
      echo "<li>$r</li>\n";
      foreach(explode("\n", $b[$i]) as $j=>$v) {
        $t = explode('$', trim($v));
        printf("<a href='%d_%d.html' target='_top'>%s</a>\n", $i+1, $j+1, $t[0]);
      }
    }<li>youku</li>
    <a href='1_1.html' target='_top'>第一集</a>
    <a href='1_2.html' target='_top'>第一集</a>
    <a href='1_3.html' target='_top'>第二集</a>
    <a href='1_4.html' target='_top'>第三集</a>
    <a href='1_5.html' target='_top'>第四集</a>
    <a href='1_6.html' target='_top'>第五集</a>
    <li>tudou</li>
    <a href='2_1.html' target='_top'>第一集</a>
    <a href='2_2.html' target='_top'>第一集</a>
    <a href='2_3.html' target='_top'>第二集</a>
    <a href='2_4.html' target='_top'>第三集</a>
    <a href='2_5.html' target='_top'>第四集</a>
    <a href='2_6.html' target='_top'>第五集</a>
    <li>down</li>
    <a href='3_1.html' target='_top'>第一集</a>
    <a href='3_2.html' target='_top'>第一集</a>
    <a href='3_3.html' target='_top'>第二集</a>
    <a href='3_4.html' target='_top'>第三集</a>
    <a href='3_5.html' target='_top'>第四集</a>
    <a href='3_6.html' target='_top'>第五集</a>
    但你的数据本该是这样的$a = 'youku$$$tudou$$$down';
    $b='第一集$1_1.html
    第二集$1_2.html
    第三集$1_3.html
    第四集$1_3.html
    第五集$1_5.html$$$第一集$2_1.html
    第二集$2_2.html
    第三集$2_3.html
    第四集$2_4.html
    第五集$2_5.html$$$第一集$3_1.html
    第二集$3_2.html
    第三集$3_3.html
    第四集$3_4.html
    第五集$3_5.html';
     
    $a = explode('$$$', $a);
    $b = explode('$$$', $b);
    foreach($a as $i=>$r) {
      echo "<li>$r</li>\n";
      foreach(explode("\n", $b[$i]) as $v) {
        $t = explode('$', trim($v));
        echo "<a href='$t[1]' target='_top'>$t[0]</a>\n";
      }
    }<li>youku</li>
    <a href='1_1.html' target='_top'>第一集</a>
    <a href='1_2.html' target='_top'>第二集</a>
    <a href='1_3.html' target='_top'>第三集</a>
    <a href='1_3.html' target='_top'>第四集</a>
    <a href='1_5.html' target='_top'>第五集</a>
    <li>tudou</li>
    <a href='2_1.html' target='_top'>第一集</a>
    <a href='2_2.html' target='_top'>第二集</a>
    <a href='2_3.html' target='_top'>第三集</a>
    <a href='2_4.html' target='_top'>第四集</a>
    <a href='2_5.html' target='_top'>第五集</a>
    <li>down</li>
    <a href='3_1.html' target='_top'>第一集</a>
    <a href='3_2.html' target='_top'>第二集</a>
    <a href='3_3.html' target='_top'>第三集</a>
    <a href='3_4.html' target='_top'>第四集</a>
    <a href='3_5.html' target='_top'>第五集</a>
      

  6.   

    非常感谢其实这就一个播放地址,abcd是播放地址,要另做它用