Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/likeneko/php_libs
常用库
https://github.com/likeneko/php_libs
Last synced: 8 days ago
JSON representation
常用库
- Host: GitHub
- URL: https://github.com/likeneko/php_libs
- Owner: LikeNeko
- Created: 2021-03-09T09:12:17.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-09-16T08:07:08.000Z (about 3 years ago)
- Last Synced: 2024-09-24T16:19:15.681Z (about 2 months ago)
- Language: PHP
- Size: 14.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
```php
// 返回一个绝对大于等于0的数
var_dump(math_gtz(-1)); // Math::GTZ(-1);
// int(0)// curl的请求封装助手方法
$info = c_get('https://baidu.com/',['info'=>'id\*@ $#!*&>.','num'=>3,'va'=>132.2222222],300);
$info = c_post('https://baidu.com/',['info'=>'id\*@ $#!*&>.','num'=>3,'va'=>132.2222222],300);// 请求失败重试3次 300ms超时
$obj = new \Neko\Libs\CUrl(3);
$info = $obj->get('https://baidu.com/',['info'=>'id\*@ $#!*&>.','num'=>3,'va'=>132.2222222],300);
// string(75) "https://baidu.com/?info=id%5C%2A%40+%24%23%21%2A%26%3E.&num=3&va=132.2222222"// 请求失败重试3次 300ms超时
$obj = new \Neko\Libs\CUrl(3);
$info = $obj->get('https://baidu.com/?api=aaaa',['info'=>'id\*@ $#!*&>.','num'=>3,'va'=>132.2222222],300);
// string(84) "https://baidu.com/?api=aaaa&info=id%5C%2A%40+%24%23%21%2A%26%3E.&num=3&va=132.2222222"// 单例
class A{
use \Neko\Libs\NSingleton;
public function __construct($a,$b,$c)
{
var_dump($a,$b,$c);
}
}
A::getInstance(1,2,3);```