FB plugin

Source Code Display Plugin

顯示具有 PHP 標籤的文章。 顯示所有文章
顯示具有 PHP 標籤的文章。 顯示所有文章

星期二, 12月 04, 2018

[Laravel] 顯示 SQL 指令


Laravel 目前並沒有像 CodeIgniter 可以直接輸入 SQL 指令,只能透過預定的函式存取想要的資料。那要如何檢查在 Laravel 中放的 SQL 指令是否正確呢?以下是建議方式:

DB::enableQueryLog();

// 你的 Laravel SQL 指命區

dd(DB::getQueryLog());

星期三, 11月 28, 2018

[PHP] how to format print_r() output data


print_r() is a useful tool for debug. add '<pre>' to format the array structure!

echo '<pre>' . print_r($data, true) . '</pre>';

星期三, 4月 18, 2018

Upgrade PHP 5.4 to PHP 5.6 on CentOS 7


Google Cloud Engine provides different version of CentOS. One is CentOS 6x, the other is CentOS 7. Both version 6x and 7 provide the PHP 54. If you need upgrade the PHP from PHP54 to PHP56, the following steps can work for me: (My environment is CentOS 7)

Step 1: Install EPEL (Skip this if EPEL installed!)

wget http://rpms.famillecollet.com/enterprise/remi-release-7.rpm

rpm -Uvh remi-release-7*.rpm epel-release-7*.rpm

熱門文章