PHP Класс PHPHtmlParser\Content

Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$attr
$blank string The following 4 strings are tags that are important to us.
$content string The content string.
$equal
$pos integer The current position we are in the content.
$size integer The size of the content.
$slash

Открытые методы

Метод Описание
__construct ( $content ) Content constructor.
char ( integer $char = null ) : string Gets the current character we are at.
copyByToken ( string $token, boolean $char = false, boolean $escape = false ) : string Copies the content until it reaches the token string.,
copyUntil ( string $string, boolean $char = false, boolean $escape = false ) : string Copy the content until we find the given string.
copyUntilUnless ( string $string, string $unless ) : string Copies the content until the string is found and return it unless the 'unless' is found in the substring.
fastForward ( integer $count ) Moves the current position forward.
getPosition ( ) : integer Returns the current position of the content.
rewind ( integer $count ) Moves the current position backward.
skip ( string $string, boolean $copy = false ) Skip a given set of characters.
skipByToken ( string $token, boolean $copy = false ) : null | string Skip a given token of pre-defined characters.

Описание методов

__construct() публичный Метод

Content constructor.
public __construct ( $content )
$content

char() публичный Метод

Gets the current character we are at.
public char ( integer $char = null ) : string
$char integer
Результат string

copyByToken() публичный Метод

Copies the content until it reaches the token string.,
public copyByToken ( string $token, boolean $char = false, boolean $escape = false ) : string
$token string
$char boolean
$escape boolean
Результат string

copyUntil() публичный Метод

Copy the content until we find the given string.
public copyUntil ( string $string, boolean $char = false, boolean $escape = false ) : string
$string string
$char boolean
$escape boolean
Результат string

copyUntilUnless() публичный Метод

Copies the content until the string is found and return it unless the 'unless' is found in the substring.
public copyUntilUnless ( string $string, string $unless ) : string
$string string
$unless string
Результат string

fastForward() публичный Метод

Moves the current position forward.
public fastForward ( integer $count )
$count integer

getPosition() публичный Метод

Returns the current position of the content.
public getPosition ( ) : integer
Результат integer

rewind() публичный Метод

Moves the current position backward.
public rewind ( integer $count )
$count integer

skip() публичный Метод

Skip a given set of characters.
public skip ( string $string, boolean $copy = false )
$string string
$copy boolean

skipByToken() публичный Метод

Skip a given token of pre-defined characters.
public skipByToken ( string $token, boolean $copy = false ) : null | string
$token string
$copy boolean
Результат null | string

Описание свойств

$attr защищенное свойство

protected $attr

$blank защищенное свойство

The following 4 strings are tags that are important to us.
protected string $blank
Результат string

$content защищенное свойство

The content string.
protected string $content
Результат string

$equal защищенное свойство

protected $equal

$pos защищенное свойство

The current position we are in the content.
protected int $pos
Результат integer

$size защищенное свойство

The size of the content.
protected int $size
Результат integer

$slash защищенное свойство

protected $slash