function countNiceStrings($fileName) { $niceStrings = [0, 0]; $input = fopen($fileName, "r") or die("Missing input!"); do { $string = fgets($input); if (isWord($string)) { if (isNiceStringV1($string)) { $niceStrings[0]++; } if (isNiceStringV2($string)) { $niceStrings[1]++; } } } while ($string != ""); fclose($input); return $niceStrings; }
<?php // Check sid if (!isset($_REQUEST['sid']) or !isWholePositiveNumber($_REQUEST['sid'])) { $_REQUEST['sid'] = 0; } // Get season data $seasons_ref = dbQuery("SELECT * FROM `{$cfg['db_table_prefix']}seasons` WHERE `id` = {$_REQUEST['sid']} AND `deleted` = 0"); $season = dbFetch($seasons_ref); // Check mod if (!isset($_REQUEST['mod']) or !isWord($_REQUEST['mod'])) { $_REQUEST['mod'] = ""; } // Check act if (!isset($_REQUEST['act']) or !isWord($_REQUEST['act'])) { $_REQUEST['act'] = ""; } // Check opt if (!isset($_REQUEST['opt'])) { $_REQUEST['opt'] = ""; }