ホームページ  >  記事  >  バックエンド開発  >  複数の爆発カットと組み合わせを行うにはどうすればよいですか?

複数の爆発カットと組み合わせを行うにはどうすればよいですか?

WBOY
WBOYオリジナル
2016-06-23 13:41:531383ブラウズ

$a='youku$$$tudou$$$down'
$b='第一集$abcd
第一集$abcd
第二集$abcd
第三集$abcd
第四集$abcd
第五集$abcd$$$第一集$abcd
第一集$abcd
第二集$abcd
第三集$abcd
第四集$abcd
第五集$abcd$$$第一集$abcd
第一集$abcd
第二集$abcd
第三集$abcd
第四集$abcd
第五集$abcd'



都是$$$分割对应
最后$或者换行分割
最后需要得到
25edfb22a4f469ecb59f1190150159c6youkubed06894275b65c1ab86501b08a632eb
1a8b4afaf24b99ff6cef87e4db5f6d31第一集5db79b134e9f6b82c0b36e0489ee08ed
2e8b1d54c636a79e8787f71efa29dab3第二集5db79b134e9f6b82c0b36e0489ee08ed
418591b69927071eea0059f1967d1f1b第三集5db79b134e9f6b82c0b36e0489ee08ed
9221d4e3cb209f27ec0990b47d7423de第四集5db79b134e9f6b82c0b36e0489ee08ed
998fe1d82bc33f1bdd4e8f5a0806e1c6第五集5db79b134e9f6b82c0b36e0489ee08ed

25edfb22a4f469ecb59f1190150159c6tudoubed06894275b65c1ab86501b08a632eb
d3ebcaaaa5922a811b692f3d6f39d705第一集5db79b134e9f6b82c0b36e0489ee08ed
8083b5cb07c70dfb1eff49e9171bd2c5第二集5db79b134e9f6b82c0b36e0489ee08ed
93cb3d5a312f19218e6f749cbcbab19a第三集5db79b134e9f6b82c0b36e0489ee08ed
730b210442e78844aaafbd2fcc499b37第四集5db79b134e9f6b82c0b36e0489ee08ed
3906e58db58357306f2980bc505abf3e第五集5db79b134e9f6b82c0b36e0489ee08ed

25edfb22a4f469ecb59f1190150159c6downbed06894275b65c1ab86501b08a632eb
dd75c54851d4879161c5fef47a95aa06第一集5db79b134e9f6b82c0b36e0489ee08ed
c11a489fa94561ad9b32b1dbd273fa8c第二集5db79b134e9f6b82c0b36e0489ee08ed
6fbd2e366924d4cd2be662c779562b73第三集5db79b134e9f6b82c0b36e0489ee08ed
0114e04731d9918bf3158a20378b80ca第四集5db79b134e9f6b82c0b36e0489ee08ed
e5c7cd8e91de6ea8ac24984029bec247第五集5db79b134e9f6b82c0b36e0489ee08ed


回复讨论(解决方案)

$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>

超链接输出错误了

$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>

错了?哪里错了?
我总不能无中生有吧?

超链接应该是
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
`````````

多个循环输出真不知道要怎么搞

错了?哪里错了?
我总不能无中生有吧?

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

*_*.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";  }}




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

$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>

非常感谢

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

声明:
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。