Scanner¶
-
php\util\Scanner implements:
IteratorA simple text scanner which can parse primitive types and strings using regular expressions.
Class Scanner
Methods
__construct($source, $charset = null)¶throws php\lang\IllegalArgumentException if $charset is invalid
Параметры:
- $source –
string, php\io\Stream- $charset –
string,null- e.g.: UTF-8, windows-1251, etc., only for Stream objects
hasNext($pattern = null)¶
Параметры:
- $pattern – php\util\Regex
Результат:
bool
next($pattern = null)¶
Параметры:
- $pattern – php\util\Regex
Результат:
string,nullnull if doesn’t has the next pattern
nextLine()¶
Результат: string,nullnull if doesn’t has the next line
hasNextLine()¶
Результат: bool
nextInt($radix = null)¶
Параметры:
- $radix –
null,int- if null then uses the default radixРезультат:
int,nullnull if doesn’t has the next int
hasNextInt($radix = null)¶
Параметры:
- $radix –
null,int- if null then uses the default radixРезультат:
bool
nextDouble()¶
Результат: float,nullnull if does not has the next double
hasNextDouble()¶
Результат: bool
skip($pattern)¶
Параметры:
- $pattern – php\util\Regex
Результат:
booltrueon success,falseon fail
useDelimiter($delimiter)¶
Параметры:
- $delimiter – php\util\Regex
Результат:
useLocale($locale)¶
Параметры:
- $locale – php\util\Locale
Результат:
useRadix($value)¶
Параметры:
- $value –
intРезультат:
getIOException()¶Get the last io exception (if does not occur then returns
null)
Результат: php\io\IOException, null
reset()¶
current()¶Uses the result of the last called
next()method
Результат: string
key()¶
Результат: int
valid()¶
Результат: bool
rewind()¶
__clone()¶private