PHP code example of lubosdz / parser-orsr

1. Go to this page and download the library: Download lubosdz/parser-orsr library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

lubosdz / parser-orsr example snippets



use lubosdz\parserOrsr\ConnectorOrsr;

public function actionFindDetailByIco()
{
	$ico = empty($_GET['ico']) ? '' : htmlspecialchars(trim($_GET['ico']));
	$out = [];

	$connector = new ConnectorOrsr();
	$results = $connector->getDetailByICO($ico);

	return $this->asJson($out);
}

public function actionFindListByCompanyName()
{
	$term = empty($_GET['term']) ? '' : htmlspecialchars(trim($_GET['term']));
	$out = [];

	$connector = new ConnectorOrsr();
	$results = $connector->findByObchodneMeno($term);

	if($results && is_array($results)){
		foreach($results as $name => $link){
			$out[] = [
				'label' => $name,
				'value' => $link,
			];
		}
	}

	return $this->asJson($out);
}

public function actionCompanyDetail()
{
	$link = empty($_GET['h']) ? '' : htmlspecialchars($_GET['h']);
	$out = [];

	if($link){
		$connector = new ConnectorOrsr();
		$out = $connector->getDetailByPartialLink($link);
	}

	return $this->asJson($out);
}