Troubleshooting of PHP errors: Difference between revisions

Jump to navigation Jump to search
Line 89: Line 89:
* 原因: 沒有設定時區
* 原因: 沒有設定時區
* 解決方法: 使用 date() 或 strtotime() 等[http://php.net/manual/en/ref.datetime.php 時間相關函數]之前,先設定時區,例 {{kbd | key = <nowiki>date_default_timezone_set("Asia/Taipei")</nowiki>}}
* 解決方法: 使用 date() 或 strtotime() 等[http://php.net/manual/en/ref.datetime.php 時間相關函數]之前,先設定時區,例 {{kbd | key = <nowiki>date_default_timezone_set("Asia/Taipei")</nowiki>}}
=== 移除非預期的空白(全形空白) ===
需要額外移除 [http://www.fileformat.info/info/unicode/char/3000/index.htm 'IDEOGRAPHIC SPACE' (U+3000)] 全形空白
<pre>
$string = str_replace(json_decode('"\u3000"'), "", $string);
$string = trim($string);
</pre>
More on: [[Data_cleaning#Remove other string look like whitespace | Remove other string look like whitespace]]


=== composer.phar: command not found 或 Could not open input file: composer.phar ===
=== composer.phar: command not found 或 Could not open input file: composer.phar ===

Navigation menu