Skip to content

Instantly share code, notes, and snippets.

@ivikramsahu
Created September 10, 2020 16:45
Show Gist options
  • Save ivikramsahu/31fdc161898c8b1098e010003a92ca0a to your computer and use it in GitHub Desktop.
Save ivikramsahu/31fdc161898c8b1098e010003a92ca0a to your computer and use it in GitHub Desktop.
A php script for reading file πŸ“‚
<?php
$fh = fopen('domain-push-to-ehr.csv','r');
while($line = fgets($fh)){
$string = trim(preg_replace('/\s\s+/', '', $line));
$file = $string."_data.txt";
if (filter_var("$string", FILTER_VALIDATE_IP)) {
echo("$string is valid IP")
continue;
} else {
echo("$string is not a valid IP address");
}
}
fclose($fh);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment