php
// ============================================== function ary2php_list ($file_path, $ary_data, $ary_prm=array()) { $func_name = $file_path; $func_name = basename(realpath($func_name)); $func_name = str_replace('.php', '', $func_name); $fu…
■配列をファイルへ書き出し // ==================================== function buta_save ($file_path, $ary_prm) { return file_put_contents($file_path, base64_encode(gzdeflate(json_encode($ary_prm, JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX_APOS | …
※サブディレクトリ内は見ない function get_child_file ($dir_name) { $ary_data = array(); if (is_dir($dir_name) === False) { return $ary_data; } $obj_dir = dir($dir_name); while (True) { $tmp_name = $obj_dir->read(); if ($tmp_name === False) …
※サブディレクトリ内は見ない function get_child_dir ($dir_name) { $ary_data = array(); if (is_dir($dir_name) === False) { return $ary_data; } $obj_dir = dir($dir_name); while (True) { $tmp_name = $obj_dir->read(); if ($tmp_name === False) {…
// ============================================== function make_amazon_url ($ary_option) { // setting $access_key_id = 'aaa';// your AWS Access Key ID $secret_access_key = 'bbb';// your AWS Secret Access Key $associate_tag = 'ccc';// your …
function urlencode_rfc3986($str_tmp) { return str_replace('%7E', '~', rawurlencode($str_tmp)); }
// aaa: id // bbb: pw $str_tmp = file_get_contents('http://aaa:bbb@hogehoge.com/test.php'); echo $str_tmp;
// ============================================== function ftp_upload ( $ftp_host ,$ftp_user ,$ftp_pass ,$file_from ,$file_to ){ $res_ftp = ftp_connect($ftp_host); if ($res_ftp === False) { return False; } $bol_flg = ftp_login($res_ftp, $f…
// ============================================== function unseter () { $tmp = array_keys($GLOBALS); krsort($tmp); foreach ($tmp as $val) { eval('unset($GLOBALS["' . $val . '"]);'); unset($val); } unset($tmp); } // ========================…
// ============================================== function han2zen ($str_prm){ $ary_han = array( ' ' ,'!' ,'"' ,'#' ,'$' ,'%' ,'&' ,"'" ,'(' ,')' ,'*' ,'+' ,',' ,'-' ,'.' ,'/' ,':' ,';' ,'<' ,'=' ,'>' ,'?' ,'@' ,'[' ,"\\" ,']' ,'^' ,'_' ,'…
■1. Gmailで「メッセージのソースを表示する」を押す■2. base64エンコードされている文字の羅列をコピーする■3. 以下PHPの文字列変数の値部分に上書きペーストする■4. PHPを実行する $str_tmp = '**********'; header('content-type: application/octet-stre…
function cke_get_contents ($str_url) { $ary_opt = array( 'http' => array( 'method' => 'GET' ,'header' => 'Accept-language: en' . "\r\n" . 'Cookie: __utma=118494749.1560495277.1336639962.1337251152.1337344331.5; __utmb=118494749.8.10.133734…
// ============================================== function do_command ($str_cmd, $str_in=''){ // define $descriptorspec = array( 0 => array('pipe', 'r') ,1 => array('pipe', 'w') ,2 => array('pipe', 'w') ); // init $bol_rtn = False; $str_ou…
★自前の関数でHTTP GETリクエストを送信するVer. ※正確じゃなくてもいいから動けばイイや。 【ga.phpの修正】 ■setrawcookieを置換 ・置換前 setrawcookie ・置換後 setcookie ■自前の関数を追加 ・新規追加
// ============================================== function do_command ($string_cmd) { $string_rtn = ''; $fp = popen($string_cmd, 'r'); while (!feof($fp)) { $string_rtn .= fread($fp, 8192); } pclose($fp); unset($fp); return $string_rtn; } /…
function make_writable_dir ($dir_path) { if (is_dir($dir_path) === False) { mkdir($dir_path); chmod($dir_path, 0777); } return is_writable($dir_path); }
function last_dom ($year, $month) { return = date('d', mktime(0, 0, 0, ($month) % 12 + 1, 0, ($month + 1) > 12 ? ($month) % 12 + 1 : $year)); }
/*DROP TABLE IF EXISTS t_session;CREATE TABLE t_session ( sess_index varchar(200) NOT NULL COLLATE utf8_bin ,sess_value text DEFAULT null COLLATE utf8_bin ,sess_life_time int(11) NOT NULL DEFAULT 0 ,PRIMARY KEY (sess_index) ,KEY i_t_sessio…
$tmp = array('a','b','c','d','e','f','g','h'); pat($tmp); function pat($arr,$level=0,$base = ""){ $num = count($arr); if($num == 0){ print $base."\n"; } for($i = 0;$i if(isset($arr[$i])){ $arrclone = $arr; unset($arrclone[$i]); pat($arrclo…
■__init__.php // ============================================== if (function_exists('date_default_timezone_set') !== False) { date_default_timezone_set('Asia/Tokyo'); } // ============================================== // ---- define ---- …
function make_rand ($int_length) { $master = array( '0','1','2','3','4','5','6','7','8','9' ,'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z' ,'A','B','C','D','E','F','G','H','I','J','…
function ary_orderby (&$ary_param, $str_orderby, $bol_desc=False) { if (strlen($str_orderby) === 0) { return False; } $ary_sortkey = array(); foreach ($ary_param as $idx_1 => $val_1){ $ary_sortkey[$idx_1] = $val_1[$str_orderby]; unset($idx…
function ary_extraction ($str_old, $str_from, $str_to){ $ary_return = array(); while (True) { $str_tmp = str_extraction($str_old, $str_from, $str_to, True); if ($str_tmp === False) { break; } $str_old = str_replace($str_tmp, '', $str_old);…
function str_extraction ($str_old, $str_from, $str_to, $plus_flag=False){ $int_from = strpos($str_old, $str_from); if ($int_from === False) { return False; } else { $int_from = $int_from + strlen($str_from); } $int_to = strpos($str_old, $s…
function ary2tsv ($file_name, $ary_param) { $bol_return = False; if (count($ary_param) === 0) { return $bol_return; } if (is_file($file_name) === False) { touch($file_name); chmod($file_name, 0777); } $int_line = 0; $fp = fopen($file_name,…
function tsv2ary ($file_name) { $ary_return = array(); if (is_file($file_name) === False) { return False; } $int_line = 0; $ary_master = array(); $fp = fopen($file_name, 'rb'); while ( ($str_tmp = fgets($fp)) !== False) { $str_tmp = str_re…
function write_file ($file_name, $file_content, $mode='wb') { if (is_file($file_name) === False) { touch($file_name); chmod($file_name, 0777); } if ( ($fp = fopen($file_name, $mode)) === False) { return False; } if ( (fwrite($fp, $file_con…
function trim_nl ($str_param) { $str_param = str_replace("\t", '', $str_param); $str_param = str_replace("\r\n", '', $str_param); $str_param = str_replace("\r", '', $str_param); $str_param = str_replace("\n", '', $str_param); $str_param = …