Scanner¶
-
php\util\Scanner
implements:
Iterator
A 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
,null
null if doesn’t has the next pattern
nextLine
()¶
Результат: string
,null
null if doesn’t has the next line
hasNextLine
()¶
Результат: bool
nextInt
($radix = null)¶
Параметры:
- $radix –
null
,int
- if null then uses the default radixРезультат:
int
,null
null if doesn’t has the next int
hasNextInt
($radix = null)¶
Параметры:
- $radix –
null
,int
- if null then uses the default radixРезультат:
bool
nextDouble
()¶
Результат: float
,null
null if does not has the next double
hasNextDouble
()¶
Результат: bool
skip
($pattern)¶
Параметры:
- $pattern – php\util\Regex
Результат:
bool
true
on success,false
on 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