PHP Class IMDBHelper, PHP-IMDB-Grabber

Inheritance: extends IMDB
ファイルを表示 Open project: fabianbeiner/php-imdb-grabber Class Usage Examples

Public Methods

Method Description
arrayOutput ( boolean $bArrayOutput, string $sSeparator, string $sNotFound, array $aReturn = null, boolean $bHaveMore = false ) : array Preferred output in responses with multiple elements
cleanString ( string $sInput ) : string
getShortText ( string $sText, integer $iLength = 100 ) : string
matchRegex ( string $sContent, string $sPattern, null $iIndex = null ) : array Regular expression helper.
runCurl ( string $sUrl, boolean $bDownload = false ) : boolean | mixed
saveImage ( string $sUrl, integer $iId ) : string

Method Details

arrayOutput() public static method

Preferred output in responses with multiple elements
public static arrayOutput ( boolean $bArrayOutput, string $sSeparator, string $sNotFound, array $aReturn = null, boolean $bHaveMore = false ) : array
$bArrayOutput boolean Native array or string with separators.
$sSeparator string String separator.
$sNotFound string Not found text.
$aReturn array Original input.
$bHaveMore boolean Have more elements indicator.
return array Multiple results separated by selected separator string.

cleanString() public static method

public static cleanString ( string $sInput ) : string
$sInput string Input (eg. HTML).
return string Cleaned string.

getShortText() public static method

public static getShortText ( string $sText, integer $iLength = 100 ) : string
$sText string The long text.
$iLength integer The maximum length of the text.
return string The shortened text.

matchRegex() public static method

Regular expression helper.
public static matchRegex ( string $sContent, string $sPattern, null $iIndex = null ) : array
$sContent string The content to search in.
$sPattern string The regular expression.
$iIndex null The index to return.
return array If no match was found.

runCurl() public static method

public static runCurl ( string $sUrl, boolean $bDownload = false ) : boolean | mixed
$sUrl string The URL to fetch.
$bDownload boolean Download?
return boolean | mixed Array on success, false on failure.

saveImage() public static method

public static saveImage ( string $sUrl, integer $iId ) : string
$sUrl string The URL to the image to download.
$iId integer The ID of the movie.
return string Local path.