1
我正在使用PHP 4,這是主機目前的功能。當給定鏈接的部分查找時,如何從字符串中提取鏈接。如何在給定部分鏈接值時提取鏈接
例
$find_string = 'http://www.mysite.com/apple';
$string = 'Something and something else
<a href="http://www.mysite.com/apple_banana">testlink</a>
something else and so forth
<a href="http://www.mysite.com/orange">orange</a>
在這種情況下,我想僅提取它具有http://www.mysite.com/apple
的聯繫,因此將檢索http://www.mysite.com/apple_bananan
任何幫助將不勝感激。
這個例子有點令人困惑 - 你能清楚你到底想要做什麼嗎?你想查找'$ string'中是否有'http:// www.mysite.com/apple'的實例? – ABach 2010-05-07 21:47:53