Skip to content

Instantly share code, notes, and snippets.

@biscuitrainbow
Created January 6, 2018 13:46
Show Gist options
  • Save biscuitrainbow/69d7ec90470aa3788eea7f10e48538bf to your computer and use it in GitHub Desktop.
Save biscuitrainbow/69d7ec90470aa3788eea7f10e48538bf to your computer and use it in GitHub Desktop.
<?php
define("DOUBLE_SLASH", "//");
$workingCode = 0;
$commentCode = 0;
$fp = fopen("index.html", "r");
while ($line = fgets($fp)) {
if (strstr($line, "//")) $commentCode++;
else $workingCode++;
}
echo 'Comment code ' . $commentCode . ' lines ';
echo 'Working code ' . $workingCode . ' lines';
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment