У меня есть много ссылок:PHP сравнить несколько строку
http://exmpale.com/abc/exmpale.html
http://exmpale.com/abc/exmpale1.html
http://exmpale.com/abc/exmpale2.html
http://exmpale.com/abc/exmpale/exmpale1.html
http://exmpale.com/abc/exmpale/exmpale2.html
http://exmpale.com/abc/exmpale/exmpale3.html
http://exmpale.com/abcd/exmpale1.html
http://exmpale.com/abcd/exmpale2.html
http://exmpale.com/abcd/exmpale2.html
http://exmpale.com/abcd/exmpale4.html
http://exmpale.com/abc/abc/exmpale1.html
http://exmpale.com/abc/abc/exmpale2.html
http://exmpale.com/abc/abc/exmpale3.html
http://exmpale.com/abc/abc/exmpale4.html
http://exmpale.com/abc/abc/exmpale5.html
Я использую PHP, я хочу, чтобы получить все ссылки, как http://exmpale.com/abc/(*).html
и перечислить его в массиве. Извините, я забыл код. код пользователя
$a = array(
0 => 'http://exmpale.com/abc/exmpale.html',
1 => 'http://exmpale.com/abc/exmpale1.html',
2 => 'http://exmpale.com/abc/exmpale2.html',
3 => 'http://exmpale.com/abc/exmpale/exmpale1.html',
4 => 'http://exmpale.com/abc/exmpale/exmpale2.html',
5 => 'http://exmpale.com/abc/exmpale/exmpale3.html',
6 => 'http://exmpale.com/abcd/exmpale1.html',
7 => 'http://exmpale.com/abcd/exmpale2.html',
8 => 'http://exmpale.com/abcd/exmpale2.html',
9 => 'http://exmpale.com/abcd/exmpale4.html',
10 => 'http://exmpale.com/abc/abc/exmpale1.html',
11 => 'http://exmpale.com/abc/abc/exmpale2.html',
12 => 'http://exmpale.com/abc/abc/exmpale3.html',
13 => 'http://exmpale.com/abc/abc/exmpale4.html',
14 => 'http://exmpale.com/abc/abc/exmpale5.html',
);
foreach($a as $k => $v){
$abc = preg_match_all('/http\:\/\/exmpale\.com\/abc\/(.*?)\.html/',$v,$b);
print_r($b[1]);
}
и я хочу получить результат.
$result = array(
'http://exmpale.com/abc/exmpale.html',
'http://exmpale.com/abc/exmpale1.html',
'http://exmpale.com/abc/exmpale2.html');
, но он принял весь результат, пожалуйста, помогите мне спасибо вам.
Я предлагаю вам взгляните на циклы и подстрочные функции. Начните искать документацию, начните использовать Google для этого. Затем запустите свой собственный скрипт, попытайтесь решить это самостоятельно. _Then_, если вы столкнетесь с проблемой _specific_ с вашим собственным кодом, _then_ - это время, чтобы спросить здесь и разместить свой код внутри вопроса. Мы здесь не для того, чтобы твоя работа для тебя. Мы здесь, чтобы помочь вам в выполнении вашей работы. – arkascha
извините, я напишу код для меня – phuochq