PHP code example of wispiring / china-economy-classification

1. Go to this page and download the library: Download wispiring/china-economy-classification 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/ */

    

wispiring / china-economy-classification example snippets


$classification = new \Wispiring\ChinaEconomyClassification\Classification();

// Get array of all the codes
$data = $classification->getArray();

// Get by code
$data = $classification->getByCode('0141');

// Get by name
$data = $classification->getByName('超级市场零售');

// Get codes by category
$data = $classification->getByTopCategory('A');
$data = $classification->getByFirstCategory('51');
$data = $classification->getBySecondCategory('389');
$data = $classification->getByThirdCategory('0141');


# single select

$classification = new \Wispiring\ChinaEconomyClassification\Classification();
// passing the name of the select widget as parameter
echo $classification->getSelectWidget('cec');
// passing both the name and the selected value
echo $classification->getSelectWidget('cec', '3399');

# 4 select combo - the cec.js is 

$classification = new \Wispiring\ChinaEconomyClassification\Classification();

// Get array for select html widget
$data = $classification->getSelectArray();