Skip to content

Commit b0bd486

Browse files
authored
Update google_ip_prefix_diff.php
1 parent 8a218c9 commit b0bd486

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

google_ip_prefix_diff.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -226,10 +226,13 @@ function get_google_ip_prefixes_difference()
226226
}
227227
}
228228

229-
/*
230-
$ip_prefixes = get_google_ip_prefixes_difference();
231-
foreach ($ip_prefixes as $cidr) {
232-
echo $cidr . PHP_EOL;
229+
// Check if the script is being run directly
230+
if (php_sapi_name() === 'cli') {
231+
$ip_prefixes = get_google_ip_prefixes_difference();
232+
233+
// Output each CIDR to the console
234+
foreach ($ip_prefixes as $cidr) {
235+
echo $cidr . PHP_EOL;
236+
}
233237
}
234-
*/
235238
?>

0 commit comments

Comments
 (0)