匹配字符串解决办法
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Lepaskan: 2016-06-13 13:40:03
asal
967 orang telah melayarinya
匹配字符串
如何返回url呢???
传入字符串:
HTML code
<!--
Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/
--><a href="http://www.macaucentral.com/dev/index.php/beauty-content/6579-celina-beauty-centre">莎莉娜美容中心 Celina ...</a>
Salin selepas log masuk
返回字符串
HTML code
<!--
Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/
-->http://www.macaucentral.com/dev/index.php/beauty-content/6579-celina-beauty-centre
Salin selepas log masuk
------解决方案--------------------
PHP code
<?php $str='<a href="http://www.macaucentral.com/dev/index.php/beauty-content/6579-celina-beauty-centre">莎莉娜美容中心 Celina ...';
$pattern='/<a>]*href="([^"\']*)"/';
preg_match($pattern,$str,$matchs);
print_r($matchs);
<br><font color="#e78608">------解决方案--------------------</font><br>
preg_match('/href="([^"]*)"/',$str,$arr);<br>echo $arr[1]; <div class="clear">
</div></a>
Salin selepas log masuk
Kenyataan Laman Web ini
Kandungan artikel ini disumbangkan secara sukarela oleh netizen, dan hak cipta adalah milik pengarang asal. Laman web ini tidak memikul tanggungjawab undang-undang yang sepadan. Jika anda menemui sebarang kandungan yang disyaki plagiarisme atau pelanggaran, sila hubungi admin@php.cn
Artikel terbaru oleh pengarang
-
2025-02-26 03:58:14
-
2025-02-26 03:38:10
-
2025-02-26 03:17:10
-
2025-02-26 02:49:09
-
2025-02-26 01:08:13
-
2025-02-26 00:46:10
-
2025-02-25 23:42:08
-
2025-02-25 22:50:13
-
2025-02-25 21:54:11
-
2025-02-25 20:45:11
Isu terkini
-
2025-03-21 13:39:34
-
2025-03-21 13:38:34
-
2025-03-21 13:37:19
-
2025-03-21 13:35:24
-
2025-03-21 13:34:32
Topik-topik yang berkaitan
Lagi>