lyhiving / mobile2brand
Guest brand logo form mobile device name and the model
1.1
2018-10-05 14:54 UTC
Requires
- php: >=5.6.0
Requires (Dev)
- phpunit/phpunit: ^5.7
This package is auto-updated.
Last update: 2024-11-15 19:50:42 UTC
README
PHP 实现根据手机设备品牌和设备型号获取设备的品牌LOGO,目前数据为自整理。输出325X260 的JPG图片。
Installation
composer require "lyhiving/mobile2brand:^1.0"
Usage
<?php use lyhiving\Mobile\Mobile2Brand; // composer 方式安装 // include './vendor/autoload.php'; // 非 composer 方式安装的,引入文件 // include './src/Mobile2Brand.php'; $mb = new Mobile2Brand(); $brand = $mb->find('LGE','Nexus 5X'); print_r($brand); // Output; google
一般情况下,我们想直接获取URL地址。
<?php use lyhiving\Mobile\Mobile2Brand; $mb = new Mobile2Brand(); $logo = $mb->url('https://raw.githubusercontent.com/lyhiving/mobile2brand/master/src/icons/')->find('Xiaomi','MI MAX 2'); print_r($logo); // Output; https://raw.githubusercontent.com/lyhiving/mobile2brand/master/src/icons/xiaomi.jpg
Tips
手机品牌logo每个厂家有不同的使用规定,如有涉及更新LOGO或者更多设备兼容,请直接提交issue 告之,我会在合适的时候更新到版本中。