Created
January 6, 2018 13:46
-
-
Save biscuitrainbow/69d7ec90470aa3788eea7f10e48538bf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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