\x 開頭編碼是 16進位的數字,可以直接轉成一般文字輸出,可詳見此篇:將 \x 開頭編碼的資料轉成中文輸出
但是想要將 \x 於 html input / textarea 傳送,再用 $_GET、$_POST 等接收 並且做轉換,要怎麼做呢?
個人筆記, 記錄關於 系統、程式、新聞 與 日常生活 等資訊
\x 開頭編碼是 16進位的數字,可以直接轉成一般文字輸出,可詳見此篇:將 \x 開頭編碼的資料轉成中文輸出
但是想要將 \x 於 html input / textarea 傳送,再用 $_GET、$_POST 等接收 並且做轉換,要怎麼做呢?
PHP CURL 要傳送 HTTP Protocol 的 Content-Length,Content-Length 這個值要怎麼計算呢?
PHP 在寫入檔案的時候(Debain Linux),函式回傳值都是正確的,但是檔案就是沒有出現,到底發生什麼事情呢?
範例程式
<?php var_dump(file_put_contents('/tmp/abc.txt', 'abc', FILE_APPEND | LOCK_EX)); // int(3) ?>
回傳 3 bytes 都是正確的,但是就是 /tmp/abc.txt 沒有產生
PHP 與 JavaScript 串接經常回傳 JSON 格式,但是會遇到 PHP 的 Array 預設 Index (Assoc array key reference index) 都會有 1、2、3 ...,要怎麼移除這 Index 在傳給 JavaScript 呢?
MySQL 8.0 要新增 DB User 的方法跟以前不太一樣,以前只要 grant 就會自動建立,現在需要另外 CREATE。
現在會需要下述步驟:
Debian Linux 由 jessie 一路升級到 buster,PHP 也由 7.1、7.2 升級到 7.3,有哪些要注意的事項呢?
PHP PECL 升級時,遇到下述錯誤訊息:
pear.php.net is using a unsupported protocol - This should never happen.
upgrade failed
要如何修復呢?
PHP 升級 PECL 遇到下述訊息:
$ sudo pecl upgrade
Warning: Invalid argument supplied for foreach() in Command.php on line 249
PHP Warning: Invalid argument supplied for foreach() in /usr/share/php/PEAR/Command.php on line 249Warning: Invalid argument supplied for foreach() in Command.php on line 249
PHP Warning: Invalid argument supplied for foreach() in /usr/share/php/PEAR/Command.php on line 249Warning: Invalid argument supplied for foreach() in PEAR/Command.php on line 249
PHP Warning: Invalid argument supplied for foreach() in /usr/share/php/PEAR/Command.php on line 249Warning: Invalid argument supplied for foreach() in PEAR/Command.php on line 249
PHP Warning: Invalid argument supplied for foreach() in /usr/share/php/PEAR/Command.php on line 249XML Extension not found
要如何修復呢?
Chrome 80 之後的版本,預設的 Cookie 設定將會無法跨站存取 Cookie 值,若想要允許 Cookie 跨網站存取的話(SameSite = None),需要使用 HTTPS 才可以。
在串接資料的時候,常常會看到 2018-06-03T08:02:20+08:00 之類的,這些日期格式大多都是有公開標準的,PHP 裡面有將大多數的標準都設定好可以直接使用囉~