PHP:
скопировать код в буфер обмена
скопировать код в буфер обмена
- <?PHP
- function isDigit( $c ) // на цыфру
- {
- if ($c == '0' || $c == '1' || $c == '2' || $c == '3' || $c == '4' ||
- $c == '5' || $c == '6' || $c == '7' || $c == '8' || $c == '9')
- {
- return true;
- }
- else {return false;}
- }
- function isDate1( $s ) //26.09.2012
- {
- {
- return false;
- }
- if (isDigit($s[0]) === true && isDigit($s[1]) === true &&
- $s[2] == '.' &&
- isDigit($s[3]) === true && isDigit($s[4]) === true &&
- $s[5] == '.' &&
- isDigit($s[6]) === true && isDigit($s[7]) === true &&
- isDigit($s[8]) === true && isDigit($s[9]) === true)
- {
- return true;
- }
- else {return false;}
- }
- function isDate2( $s ) // 6.09.2012
- {
- {
- return false;
- }
- if (isDigit($s[0]) === true &&
- $s[1] == '.' &&
- isDigit($s[2]) === true && isDigit($s[3]) === true &&
- $s[4] == '.' &&
- isDigit($s[5]) === true && isDigit($s[6]) === true &&
- isDigit($s[7]) === true && isDigit($s[8]) === true)
- {
- return true;
- }
- else {return false;}
- }
- function isCurs( $s ) // 8.27 UAH
- {
- {
- return true;
- }
- else {return false;}
- }
- $countCurs = 0;
- $countDate = 0;
- {
- //на тег
- {
- while ($str[$i] != ">")
- {
- $i++;
- }
- $j = $i;
- while($str[$j] != '<')
- {
- $j++;
- }
- //дозапись в файл
- if ( !$file_result )
- {
- echo("Ошибка открытия файла");
- }
- else
- {
- if(isDate1($res) === true || isDate2($res) === true)
- {
- $countDate++;
- }
- if(isCurs($res) === true)
- {
- $countCurs++;
- }
- }
- }
- //Удалим 31 скроку из файла
- $max = 30;
- {
- }
- }
- ?>