我使用file_get_contents從網頁生成一個數組,其中包含file_get_contents,如果它們包含特定數據,我想刪除條目的(值爲&)值。PHP:從陣列中刪除條目,其中包含
例如:
[0] = 'http://somesite.com'
[1] = 'http://someothersite.com/article/id/55/file.pdf'
[2] = 'http://someothersite.com/article/id/56/file2.pdf'
[3] = 'javascript:void(0)'
[4] = 'mailto:[email protected]'
我想刪除該條目
http://somesite.com
javascript:void(0)
mailto:[email protected]
因爲我只需要在URL的與.pdf文件。
我該怎麼做?
那麼,爲什麼你不修改你的初始uri獵犬? – dead