原创 PHP導入Excel文件後綴xlsx與xls的處理問題

public function importData(){ //先執行文件上傳 $file = $this->request->file('files');//獲取表單上傳文件 if(em

原创 PHP curl 獲取錯誤

  if(curl_exec($ch) === false) { echo 'Curl error: ' . curl_error($ch); } else { echo '操作完成沒有任何錯誤'; } 獲取curl返回

原创 PHP thinkphp 在 linux windows 下 獲取 MAC地址

 PHP thinkphp 在 linux windows 下 獲取 MAC地址 public static function getMacAddress(){ if(strtolower(PHP_OS) == 'lin

原创 Windows與Linux下MySQL命令行下執行sql文件導入導出

連接MySQL  mysql -uroot -p***; use 要導入/導出的數據庫名 use databaseName;  windows: 導入命令 source 後面跟sql文件路徑 source d:/databaseName.

原创 正則表達式驗證密碼是數字字母特殊符號且六位以上組合

js 正則表達式驗證密碼(6位以上數字字母特殊符號組合) function checkPsw(password){ //密碼必須是數字、字母、特殊符號混合,且大於6位 var patrn = /^(?=.*[a-zA-Z

原创 PHP百度地圖多點聚合問題

PHP部分 public function point(){ //獲取IP值 $ip = $_SERVER["REMOTE_ADDR"]; //根據IP獲取中心點座標,api可以百度申請(免費的) $content =

原创 PHP項目部署nginx報HTTP ERROR 500錯誤

查看報錯信息 修改php.ini配置文件 文件默認位置"/usr/local/php/etc/php.ini" 搜索display_errors與display_startup_errors 並將改兩處修改爲 display_errors

原创 百度地圖api軌跡回放

原文鏈接:https://blog.csdn.net/canpark/article/details/11962805#commentsedit   <!DOCTYPE html> <html

原创 PHP錯誤:SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client

  php連接mysql8.0 報錯 修改mysql配置文件mf.cnf, vi /etc/my.cnf 添加一行   default_authentication_plugin=mysql_native_password   重啓

原创 php7.3導入Excel strpos(): Non-string needles will be interpreted as strings in the future.

修改該行代碼 // $nullOffset = strpos($url, 0x00);  $nullOffset = strpos($url, chr(0x00));

原创 MySQL在一張表中的一對多如何查詢

SELECT tel, GROUP_CONCAT( workno SEPARATOR ',' ) AS workno FROM test GROUP BY tel; 去除重複的workno SELECT tel,

原创 php7.3 "continue" targeting switch is equivalent to "break"

php 7.3 版本導入Excel時報錯 "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? 解決辦法找到報錯位

原创 php 使用curl請求https 錯誤碼 errcode 43009 errmsg post參數需要json類型

$url = 'https://www.xxx.com'; $header = array('Content-Type:application/json;Charset=utf-8');//增加$header 設置 Content-Typ

原创 MySQL 導入sql文件報 1115 - Unknown character set: 'utf8mb4' 錯誤

將sql文件用編輯器打開,找到SET NAMES utf8mb4部分 將utf8mb4修改爲utf8 保存。 修改位置截圖 嘗試在重新導入,即可完整導入到數據庫中。

原创 Linux隨筆整理

1,nginx 查看版本命令 /usr/local/nginx/sbin/nginx -V 2,nginx重啓命令 /usr/local/nginx/sbin/nginx -s reload service nginx restart 3