PHP code example of catname / productinfo
1. Go to this page and download the library: Download catname/productinfo 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/ */
catname / productinfo example snippets
use Catname\ProductInfo\ProductInfo;
class example
{
public function aExample(Request $request)
{
$productInfo = new ProductInfo();
return $productInfo->getProductInfo($request->code);
}
/**
* array (size=4)
'code' => string '06907992512570' (length=14)
'supplier' => string '内蒙古伊利实业集团股份有限公司' (length=45)
'name' => string '安慕希希腊风味酸奶205克' (length=33)
'specs' => string '205克' (length=6)
*/
}