![]() |
[طلب] مساعدة في كود برمجي لاستخراج الروابط السلام عليكم ورحمة الله وبركاته عندي كود برمجي يقوم باستخراج روابط محددة من النص رمز PHP: $adlan = "http://www.traidnt.net/vb/traidnt2361969/ http://www.traidnt.net/vb/u93553/ http://www.traidnt.net/vb/misc.php?do=bbcode http://www.traidnt.net/vb/sendmessage.php"; function getUrls($string) { $regex = '/https?\:\/\/[^\" ]+/i'; preg_match_all($regex, $string, $matches); return ($matches[0]); } $urls = getUrls($adlan); foreach($urls as $url) { $url = strip_tags($url); $url_pattern = '((https?|ftp|http):((//)|(\\\\))?(www[.])?(traidnt)+[\w\d:#@%/;$()~_?\+-=\\\.&]*)'; $myString = $url; preg_match_all($url_pattern, $myString, $matches); foreach($matches[0] as $key => $link) { if (@!in_array($link, $links)) { $links[] = $link; } } } الكود هذا فيه مشكلة مثلا اريد استخراج رابط :: TRAIDNT FORUM :: - Powered by vBulletin يكون تمام بس لو كان في النص رابط بهذا الشكل كمان يستخرجه http://www.traidnt11111.net انا اريد فقط النطاق الي احدده انا ويستخرجه مع النطاقات الفرعية تبعه مثال http://vb.traidnt.net وشكرا لكم مقدما على المساعدة |
الساعة الآن 02:07 AM |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.5.2 TranZ By
Almuhajir