<?php
$code
=
file_get_contents
(
"offer.php"
);
$pattern_get
=
'/isset\($_GET\[\'(.*?)\'\]/'
;
$pattern_value
=
'/$_GET\[\'(.*?)\'\]\s*==\s*"(.*?)"/'
;
preg_match_all(
$pattern_get
,
$code
,
$matches_get
, PREG_SET_ORDER);
preg_match_all(
$pattern_value
,
$code
,
$matches_value
, PREG_SET_ORDER);
$getValues
= [];
$values
= [];
foreach
(
$matches_get
as
$match
) {
$getValues
[] =
$match
[1];
}
foreach
(
$matches_value
as
$match
) {
$values
[] =
$match
[2];
}
print_r(
$getValues
);
print_r(
$values
);
for
(
$i
= 0;
$i
<
count
(
$getValues
);
$i
++) {
$url
=
'example.com/?'
.
$getValues
[
$i
] .
'='
.
$values
[
$i
];
echo
$url
.
'<br>'
. PHP_EOL;
}
?>