| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- <?php
- namespace App\Sports\Controller;
- use BaseController\Controller;
- use Biz\Match\GetmatchData;
- class Css extends Controller {
- public function index(){
- $data['s_time'] =$this->ts_time();
- $s = $_REQUEST['data'];
- $arr = [];
- if(strstr($s,',')){
- $arr1 = explode(",", $s);
- if(!empty($arr1)){
- foreach($arr1 as $k=>$v){
- $arr[]= (int)$v*100;
- }
- }
- }else{
- for($i=0;$i<=$s;$i++){
- $arr[] = $i+1;
- }
- }
- $data['num'] = count($arr);
- $data['e_time'] =$this->ts_time();
- Render($data, '1', lang('Tips','Sports')->get('success'));
- }
- /**
- * 年月日、时分秒 + 3位毫秒数
- * @param string $format
- * @param null $utimestamp
- * @return false|string
- */
- public function ts_time($format = 'Y-m-d H:i:s.u', $utimestamp = null) {
- if (is_null($utimestamp)){
- $utimestamp = microtime(true);
- }
-
- $timestamp = floor($utimestamp);
- $milliseconds = round(($utimestamp - $timestamp) * 1000);
-
- return date(preg_replace('`(?<!\\\\)u`', $milliseconds, $format), $timestamp);
- }
- }
|