Changeset 24 for trunk/Meet.php
- Timestamp:
- Dec 26, 2018, 10:45:44 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Meet.php
r23 r24 104 104 } 105 105 106 function is_white_space($Char) 107 { 108 return ($Char == ' ') or ($Char == "\t"); 109 } 110 106 111 function GetNumberBeforeText($Text, $Needle) 107 112 { … … 120 125 $Text = substr($Text, $Pos + 1); 121 126 $Start = $Pos - 1; 122 while (($Start >= 0) and (is_numeric($Result[$Start]) or ($Result[$Start] == ' ')))127 while (($Start >= 0) and (is_numeric($Result[$Start]) or is_white_space($Result[$Start]))) 123 128 $Start--; 124 129 $Start++; … … 146 151 $Text = substr($Text, $Pos + 1); 147 152 $End = 0; 148 while (($End < strlen($Result)) and (is_numeric($Result[$End]) or ($Result[$End] == ' ')))153 while (($End < strlen($Result)) and (is_numeric($Result[$End]) or is_white_space($Result[$End]))) 149 154 $End++; 150 155 $End--; … … 167 172 if ($Result == '') $Result = GetNumberAfterText($Text, 'čerstvých'); 168 173 if ($Result == '') $Result = GetAgeHeightWeightFromText($Text)[0]; 169 if ($Result == '') $Result = date('Y', time()) - GetNumberAfterText($Text, 'ročník'); 174 if ($Result == '') { 175 $Year = GetNumberAfterText($Text, 'ročník'); 176 if ($Year != '') $Result = date('Y', time()) - $Year; 177 } 170 178 return $Result; 171 179 }
Note:
See TracChangeset
for help on using the changeset viewer.