I want to search *.rules from this site http://cvs.snort.org/viewcvs.cgi/snort/rules/
and copy the strings of files into an array
how can I do this?
for example:
$array=array('backdoor.rules','bad-traffic.rules');
I can use
$str=file_get_contents( 'http://cvs.snort.org/viewcvs.cgi/snort/rules');
but how can I search?
You need to use a regex to get any matches of the source
This code will fetch the contents of the web page, and run a regex which matches any link that has .rules in it.
Inside the loop you can then save the files (using file_get_contents , and then fopen, fwrite and fclose)