Categories
Programming/php

[memo] php.ini , short_open_tag

php 程式檔案開頭使用 <? 簡寫

須在 php.ini 設定 short_open_tag = On

Categories
Copy_N_Paste Programming/php

[PHP] Native SQLRELAY connect / query sample code

Categories
Programming/php Service System/Linux/Unix*

webhd.monster.tw : Use docker , nextcloud (a dropbox like web storage opensource) …. and docker startup commands …

URL: https://webhd.monster.tw/

Categories
Programming/php Software

[memo] 在 PHP 使用 ssh tunnel 連接遠端的 mysql server

 

Screenshot 2016 02 05 20 42 26

Categories
Programming/php System/Linux/Unix*

PECL PHP REDIS client library phpredis

URL : https://github.com/phpredis/phpredis#classes-and-methods

redis.ini file in /etc/php5/conf.d with the following contents: extension=redis.so

Categories
DATABASE Programming/php

[PHP] Sample code : Berkeley DB , bdb , dba_open , db4 , key-value database ,

$id = dba_open("bdb4_tsid.db", "w", "db4");

if (!$id) { echo "dba_open failed\n"; exit; }

dba_replace("key", "This is an example!", $id);

if (dba_exists("key", $id)) {
        echo dba_fetch("key", $id);
        dba_delete("key", $id);
}

dba_close($id);

Screenshot 2015 05 13 20 28 39

 

 

Screenshot 2015 05 13 20 37 56

 

This is an example!
exist:
This is an example!
---> This is an example!

Categories
Programming/php

PHP Regex Validation of Hexadecimal Values / check hex number

preg_match( '/^[A-F0-9]{15,18}/',$v)

 

Screenshot 2015 05 10 10 53 23

Categories
Programming/php

PHP 的 mktime , time format , 週編號 , week number of year, weeks starting on Monday

Screenshot 2015 02 06 15 31 50

 

1419696000
52 - 2014-12-29 00:00:00
52 - 2014-12-30 00:00:00
52 - 2014-12-31 00:00:00
00 - 2015-01-01 00:00:00
00 - 2015-01-02 00:00:00
00 - 2015-01-03 00:00:00
00 - 2015-01-04 00:00:00
01 - 2015-01-05 00:00:00
01 - 2015-01-06 00:00:00
01 - 2015-01-07 00:00:00

Categories
Copy_N_Paste Programming/php

Protected: PHP exception handling : using try catch exception syntax sample code

This content is password protected. To view it please enter your password below:

Categories
DATABASE Programming/php System/Linux/Unix*

[memo] Oracle : 把資料用 UTF8 編碼存進 table / NLS_LANG / NCHAR / NVARCHAR / NLS_CHARACTERSET / NLS_NCHAR_CHARACTERSET / SQL plus

UTF8 sample:

螢幕快照 2014-10-28 下午9.21.47

URL : http://www.unicode.org/cgi-bin/GetUnihanData.pl?codepoint=竝

螢幕快照 2014-10-28 下午9.28.02

Oracle : 把資料用16進位印出來 dump(field,16)
螢幕快照 2014-10-28 下午8.30.11

螢幕快照 2014-10-28 下午8.35.36

 

用 locale -a 看 系統支援的 locales

參考 : Oracle® Database Globalization Support Guide : http://docs.oracle.com/cd/E11882_01/server.112/e10729/toc.htm