【#はてなAPI認証】【#不完全なコード】このコードは機能しません.

2024.07.03

Logging

おはようございます.久々にAPI認証で躓いています.この頃は躓いたことがなかったのですがはてなAPI認証で躓いております.エラー内容があまりにもアバウト過ぎて何処の項目でエラーになっているのかがわからない感じです.分かった方はコメント欄にコメント頂けたらと思っています.宜しくお願い致します.

oauthSignatureを作っているところでコケているぽっいと思っているのですが、それが正しいのかどうかも定かではないです.近日中にcurlから参考にしているような方法に変えてみようと思っています.

参考にしたサイトはQiitaの質問に記載していますので良かったら覗いてみてください.

<?php
ini_set('display_errors', 1);
require '../config/config.php';

class hatena
{
    public $oauthCallback = OAUTH_CALLBACK;
    public $oauthConsumerKey = OAUTH_CONSUMER_KEY;
    public $oauthConsumeSecret = OAUTH_CONSUMER_SECRET;
    public $oauthNonce = '';
    public $oauthSignature = null;
    public $oauthSignatureMethod = "HMAC-SHA1";
    public $oauthTimestamp = '';
    public $oauthVersion = "1.0";
    public $contentType = 'application/x-www-form-urlencoded';
    public $oauthParameters = [];

    public function oauthInitiate()
    {

        $url = 'https://www.hatena.com/oauth/initiate';
        $this->oauthNonce = uniqid();
        $this->oauthTimestamp = time();

        $this->oauthParameters = [
            'oauth_consumer_key' => rawurlencode($this->oauthConsumerKey),
            'oauth_nonce' => rawurlencode($this->oauthNonce),
            'oauth_signature_method' => rawurlencode($this->oauthSignatureMethod),
            'oauth_timestamp' => rawurlencode($this->oauthTimestamp),
        ];


        $params = [
            'scope' => 'read_public,write_public,read_private,write_private'
        ];

        $this->getSignature($url, 'POST', $params);
        $this->oauthParameters['oauth_signature'] = rawurlencode($this->oauthSignature);

        $ch = curl_init($url);

        $headers = [ //'.$this->oauthParameters['realm'].'
            'Authorization: OAuth realm="",oauth_callback="' .  rawurlencode($this->oauthCallback) . '",oauth_consumer_key="' . $this->oauthParameters['oauth_consumer_key'] . '",oauth_nonce="' . $this->oauthParameters['oauth_nonce'] . '",oauth_signature="' . $this->oauthParameters['oauth_signature'] . '",oauth_signature_method="' . $this->oauthParameters['oauth_signature_method'] . '",oauth_timestamp="' . $this->oauthParameters['oauth_timestamp'] . '",oauth_version="1.0"',
            'Content-Type: ' . $this->contentType,
            'Content-Length: ' . (string)strlen($this->contentType)
        ];


        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($ch, CURLOPT_POST, true);
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
        curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
        $response = curl_exec($ch);
        if (curl_error($ch)) {
            echo 'Curl error: ' . curl_error($ch);
        }
        parse_str($response, $response_params);
        var_dump($response_params);
        curl_close($ch);

        return $this;
    }

    public function getSignature($url, $method = 'POST', $params = [], $oauthTokenSecret = '')
    {

        foreach($params as $key=>$value){
            $params[$key] = rawurlencode($value);
        }
        $hasBase = http_build_query($this->oauthsort(array_merge($this->oauthParameters, $params)), '', '&', PHP_QUERY_RFC3986);

        $signingKey = implode('&', [rawurlencode($this->oauthConsumeSecret), rawurlencode($oauthTokenSecret)]);
        $baseString = implode('&', [
            rawurlencode($method),
            rawurlencode($url),
            $hasBase,
        ]);

        $signature = hash_hmac('sha1', $baseString, $signingKey, true);
        $signature = base64_encode($signature);
        $this->oauthSignature = $signature;

        return $this;
    }
    //OAuth式 パラメータのソート関数
    public function oauthsort($a)
    {
        $b = array_map(null, array_keys($a), $a);
        usort($b, ['hatena', 'oauthcmp']);
        $c = array();
        foreach ($b as $v) {
            $c[$v[0]] = $v[1];
        }

        return $c;
    }
    public function oauthcmp($a, $b)
    {
        return strcmp($a[0], $b[0])
            ? strcmp(rawurlencode($a[0]), rawurlencode($b[0]))
            : strcmp(rawurlencode($a[1]), rawurlencode($b[1]));
    }
}

(new hatena)->oauthInitiate();

こちらでも解決策を模索してみます.解決出来れば追記したいと思っています.

追記::解決出来ました.

明日へ続く.

著者名  @taoka_toshiaki

Profile
高知県在住の@taoka_toshiakiです、記事を読んで頂きありがとうございます.
数十年前から息を吸うように日々記事を書いてます.たまに休んだりする日もありますがほぼ毎日投稿を心掛けています😅.
SNSも使っています、フォロー、いいね、シェア宜しくお願い致します🙇.
SNS::@taoka_toshiaki

タグ

application, Authorization, Content-Length, contentType, curl, foreach, getSignature, implode, oauthConsumerKey, oauthConsumeSecret, oauthParameters, oauthSignature, oauthSignatureMethod, oauthsort, oauthTimestamp, Qitta, rawurlencode, string, strlen, uniqid,

x.comのAPI(FREE)にて自分のユーザー情報を取得するには

2024.06.05

Logging

おはようございます.x.comのAPI(FREE)にて自分のユーザー情報を取得するにはってググってもv1.1の情報だらけだったので情報を記載します.v2対応です.一部、有料でないと取得できない部分があり返却もエラーで返ってきますが、雛形コードを記載します.

注意事項
TwitterOAuthというComposerライブラリを使用しています.
APIなどの値はご自身のAPIに合わしてください.

参考にしたサイト
https://developer.x.com/en/docs/twitter-api/users/lookup/api-reference/get-users-me

<?php
date_default_timezone_set('Asia/Tokyo');
require_once "../vendor/autoload.php";

use Abraham\TwitterOAuth\TwitterOAuth;

class xMyProfile
{

    public $connection = null;
    public $response = null;

    public function __construct()
    {
        $this->connection = new TwitterOAuth(APIKEY, APISECRET, ACCESSTOKEN, ACCESSTOKENSECRET);
        $this->connection->setApiVersion("2");
        $this->response = $this->connection->get('users/me', [
            'expansions'=>'pinned_tweet_id',
            'tweet.fields'=>implode(',',[
                'attachments',
                'author_id',
                'context_annotations',
                'conversation_id',
                'created_at',
                'edit_controls',
                'entities',
                'geo',
                'id',
                'in_reply_to_user_id',
                'lang',
                'non_public_metrics',
                'public_metrics',
                'organic_metrics',
                'promoted_metrics',
                'possibly_sensitive',
                'referenced_tweets',
                'reply_settings',
                'source',
                'text',
                'withheld'
            ]),
            'user.fields' => implode(',', [
                'created_at',
                'description',
                'entities',
                'id',
                'location',
                'most_recent_tweet_id',
                'name',
                'pinned_tweet_id',
                'profile_image_url',
                'protected',
                'public_metrics',
                'url',
                'username',
                'verified',
                'verified_type',
                'withheld'
            ])
        ]);
        return $this;
    }

    /**
     * プロフィール情報全てを取得
     */
    public function getMyProfile()
    {
        return $this->response;
    }
    /**
     * プロフィールアイコンURLを取得
     */
    public function getIconUrl()
    {
        return $this->response->data->profile_image_url;
    }
}
var_dump((new xMyProfile)->getMyProfile());
//print (new xMyProfile)->getIconUrl();

この記事はQiitaに掲載していた記事になります.

明日へ続く.

著者名  @taoka_toshiaki

Profile
高知県在住の@taoka_toshiakiです、記事を読んで頂きありがとうございます.
数十年前から息を吸うように日々記事を書いてます.たまに休んだりする日もありますがほぼ毎日投稿を心掛けています😅.
SNSも使っています、フォロー、いいね、シェア宜しくお願い致します🙇.
SNS::@taoka_toshiaki

タグ

connection, construct, edit_controls, getIconUrl, getMyProfile, implode, lt, null, organic_metrics, print, promoted_metrics, public, qiita, quot, response, return, use AbrahamTwitterOAuthTwitterOAuth, users, vendor, X.com,

ダミー情報を生成する定番.

2024.03.29

Logging

ダミー情報を生成する定番を生成する定番のコードを記載します.
Composerを使用し’faker’をインストールします.

composer require fakerphp/faker

使用方法例のコードとしてcsv出力するコードを記載(下記).

<?php
require 'vendor/autoload.php';
use Faker\Factory;

class CsvGenerate{
    /**
     * ダミー情報を生成する
     * @param int $max
     * @return string
     */
    public function csvMake(int $max=0):string
    {
        $faker = Factory::create('ja_JP');
        $hasData = [];
        for($i=0;$i<$max;$i++){
            $datas = [];
            $datas[0] = $faker->name();
            $datas[1] = $faker->email();
            $datas[2] = $faker->phoneNumber();
            $datas[3] = $faker->address();
            $hasData[$i] = implode(',',$datas);
        }

        return implode(PHP_EOL,$hasData);
    }
}

print((new CsvGenerate)->csvMake(1000));
//file_put_contents('data.csv',(new CsvGenerate)->csvMake(1000));

実際使用する場合は、file_put_contents行のコメントを解除してください.
同階層にdata.csvファイルが作成されます.
尚、コマンドよりファイルを実行することを想定しています.

※参考にしたサイト
https://fakerphp.github.io/
https://qiita.com/kurosuke1117/items/c672405ac24b03af2a90

明日へ続く.

著者名  @taoka_toshiaki

Profile
高知県在住の@taoka_toshiakiです、記事を読んで頂きありがとうございます.
数十年前から息を吸うように日々記事を書いてます.たまに休んだりする日もありますがほぼ毎日投稿を心掛けています😅.
SNSも使っています、フォロー、いいね、シェア宜しくお願い致します🙇.
SNS::@taoka_toshiaki

タグ

$datas, $hasData, Address, Composer, create, csvMake, faker’, gt, implode, items, lt, name, phoneNumber, php require, print, qiita.com, string, vendor,

Photo by Igor Haritanovich on Pexels.com

ワードプレスの自動タグ生成するプラグイン再開発。 #wp #tag

2022.12.12

Logging

おはようございます、今年もあと半分とちょっとですね、月曜日のたわわ☕。

さて、今日はワードプレスの自動タグ生成するプラグイン再開発しましたってお話です、この自動タグを生成するツールは以前、作っていたのですがYahoo!APIのバージョンアップに伴い使用出来なくなっていました。その為、プラグインを更新しV2対応をこの度、行ったって話です。もともと日本語記事のタグ自動生成するものは存在していたのですが、それがエラーで使用出来なくなり自分で開発したのが今に至っています。

プラグインをダウンロードして使いたい方は、zipファイルを解凍し解凍したフォルダをサーバーのプラグイン置き場にアップロードすることにより使用出来るようになります。尚、前手順としてYahoo!APIのアプリケーションIDの取得を行う必要があります。

プラグインをダウンロードしたくないという方のためにソースコードを一部貼っときます。

        if (isset($appid)) {
            $endpoint = "https://jlp.yahooapis.jp/KeyphraseService/V2/extract";
            $headers = [
                "Content-Type: application/json",
                "User-Agent: Yahoo AppID: ".$appid,
            ]; 
            $param = [
                "id"=> time(),
                "jsonrpc" => "2.0",
                "method" => "jlp.keyphraseservice.extract",
                "params" => [
                    "q"=>preg_replace("/https?:([a-zA-Z0-9|\/|_|\-|%|@|\*|\.|\?|&|=]){0,}/m","",$content)
                    ]
                ];

                $curl=curl_init($endpoint);
                curl_setopt($curl,CURLOPT_POST, TRUE);
                curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
                curl_setopt($curl,CURLOPT_POSTFIELDS, json_encode($param));
                curl_setopt($curl,CURLOPT_SSL_VERIFYPEER, FALSE);
                curl_setopt($curl,CURLOPT_SSL_VERIFYHOST, FALSE);
                curl_setopt($curl,CURLOPT_RETURNTRANSFER, TRUE);
                
                $response =  json_decode(curl_exec($curl));


            if (isset($response->result->phrases)) {
                foreach ($response->result->phrases as $keys=>$word) {
                    if ($word->text) {
                        $tags[] = $word->text;
                    }
                    if (is_array($tags)) {
                        wp_set_post_tags($post_id, implode(",", array_unique($tags)), false);
                    }
                }
            }
        }

著者名  @taoka_toshiaki

Profile
高知県在住の@taoka_toshiakiです、記事を読んで頂きありがとうございます.
数十年前から息を吸うように日々記事を書いてます.たまに休んだりする日もありますがほぼ毎日投稿を心掛けています😅.
SNSも使っています、フォロー、いいね、シェア宜しくお願い致します🙇.
SNS::@taoka_toshiaki

タグ

application, false, foreach, gt, headers, implode, isset, jlp, json_decode, json_encode, keys, PARAM, phrases, quot, quot;User-Agent, response, result, Text, true, VERIFYHOST,

WordPress自動日本語タグを吐き出しプラグインを作りました。

2018.11.17

Logging

WordPress自動日本語タグを吐き出しプラグインを作りました。
あのjapanese autotagというプラグインと考え方は同じですが、
自分が作ったものはその簡略化したものです。
ソースコードは全ったく違う感じですが、動作は似たような感じです。
機能はjapanese autotagよりかは少ないですが、これだけで十分かなと思います。
ダウンロードはこちらから
https://zip358.com/tool/jp-auto-tag.zip [v2に対応済み]
尚、Yahoo デベロッパーのアプリケーションIDが必要となります。
ソースコードは下記になります。※v1のソースコードなので今は動きません!!最新の記事を参照ください。

<?php
/*
Plugin Name: jp-auto-tag
Version: 0.1.11
Description: auto jp tag
Author: taoka toshiaki
Author URI: https://zip358.com/
Plugin URI: https://wordpress.org/extend/plugins/jp-auto-tag/
*/
class jp_auto_tag{
    public $db_option = "jp_auto_tag";
    //api
    public $results = "ma";
    public $filter = array("1","2","3","4","5","6","7","8","9","10","11","12","13");
    function frm_page(){
        add_menu_page('jp-auto-tag','jp-auto-tag',  'manage_options', __FILE__, array($this,'show_text_option_page'), '',8);
    }
    function show_text_option_page(){
        wp_enqueue_style( 'bootstrap', 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css', array(), '3.3.6' );
        wp_enqueue_script( 'bootstrap', 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js', array(), '3.3.6');
        $options = get_option($this->db_option);
        if(!empty($options)){
            $appid = $options["appid"];
            foreach ($this->filter as $key => $value) {
               if($options["filter".$value] == $value){
                    $f[] = "checked";
               }else{
                   $f[] = "";
               }
            }
        }
        include_once dirname( __FILE__ ).'/jp-auto-tag-tmp.php';
    }
    function ajax_event(){
        $appid = $_POST["appid"];
        $filter =$_POST["filter"];
        $options["appid"] = $appid;
        foreach ($this->filter as $key => $value) {
            if(in_array($value,$filter,true)){
                $options["filter".$value] = $value;
            }else{
                $options["filter".$value] = "";
            }
        }
        update_option($this->db_option, $options);
        $obj["appid"] = $appid;
        $obj["filter"] = $filter;
        print json_encode($obj);
        die(0);
    }
    function api_tag($post_id){
ini_set("display_errors",1);
        $post = get_post($post_id);
        $title = $post->post_title;
        $content = strip_tags($post->post_content);
        $sentence = $title.$content;
        if(strlen($sentence)>102400){
            $sentence = substr($sentence,0,102400);
        }
        $options = get_option($this->db_option);
        if(!empty($options)){
            $appid = $options["appid"];
            foreach ($this->filter as $key => $value) {
               if($options["filter".$value] == $value){
                    $f[] = $value;
               }
            }
        }
        if($appid){
            $filter = implode("|",$f);
            if(!$filter){
                $url = "https://jlp.yahooapis.jp/MAService/V1/parse?appid=$appid&results=$this->results&sentence=".urlencode($sentence);
            }else{
                $url = "https://jlp.yahooapis.jp/MAService/V1/parse?appid=$appid&results=$this->results&ma_filter=$filter&sentence=".urlencode($sentence);
            }
            $xml = @file_get_contents($url);
            $xml_obj = simplexml_load_string($xml);
            if($xml_obj->ma_result->word_list){
                foreach($xml_obj->ma_result->word_list->word as $word) {
                    if($word->surface){
                        $tags[] = $word->surface;
                    }
                    if(is_array($tags)){
                        wp_set_post_tags($post_id, implode(",",array_unique($tags)), false);
                    }
                }
            }
        }
    }
}
$jp_auto_tag = new jp_auto_tag();
add_action('save_post',array($jp_auto_tag,'api_tag'));
add_action('publish_post',array($jp_auto_tag,'api_tag'));
add_action('admin_menu', array($jp_auto_tag, 'frm_page'));
add_action('wp_ajax_ajax_event',array($jp_auto_tag,'ajax_event'));
<form id="ajax-frm">
<table class="table">
    <tr>
        <td>
            アプリケーションID
        </td>
        <td>
            <input type="text" name="appid" value="<?=$appid?>" class="form-control">
        </td>
    </tr>
    <tr>
        <td>
            解析結果として出力する品詞
        </td>
        <td>
            <input type="checkbox" name="filter[]" value="1" <?=$f[0]?>  class="form-control">1 : 形容詞
            <input type="checkbox" name="filter[]" value="2" <?=$f[1]?> class="form-control">2 : 形容動詞
            <input type="checkbox" name="filter[]" value="3" <?=$f[2]?> class="form-control">3 : 感動詞
            <input type="checkbox" name="filter[]" value="4" <?=$f[3]?> class="form-control">4 : 副詞
            <input type="checkbox" name="filter[]" value="5" <?=$f[4]?> class="form-control">5 : 連体詞
            <input type="checkbox" name="filter[]" value="6" <?=$f[5]?> class="form-control">6 : 接続詞
            <input type="checkbox" name="filter[]" value="7" <?=$f[6]?> class="form-control">7 : 接頭辞
            <input type="checkbox" name="filter[]" value="8" <?=$f[7]?> class="form-control">8 : 接尾辞
            <input type="checkbox" name="filter[]" value="9" <?=$f[8]?> class="form-control">9 : 名詞
            <input type="checkbox" name="filter[]" value="10"<?=$f[9]?>  class="form-control">10 : 動詞
            <input type="checkbox" name="filter[]" value="11"<?=$f[10]?>  class="form-control">11 : 助詞
            <input type="checkbox" name="filter[]" value="12"<?=$f[11]?>  class="form-control">12 : 助動詞
            <input type="checkbox" name="filter[]" value="13"<?=$f[12]?>  class="form-control">13 : 特殊(句読点、カッコ、記号など)
        </td>
    </tr>
    <tr>
        <td colspan="2"><input type="button" id="frmsubmit" value="登録する" class="form-control"></td>
    </tr>
</table>
</form>
<script>
    jQuery(function($){
        $("#frmsubmit").on("click",function(){
            var ajaxurl = '<?=admin_url( 'admin-ajax.php');?>';
            var data = $("#ajax-frm").serializeArray();
            data.push({name:"action",value:"ajax_event"});
            $.ajax({
               type:'POST',
               url:ajaxurl,
               data:data,
               success:function(obj){
                   console.log(obj);
                   if(obj.appid!==""){
                       alert("更新しました");
                   }
               }
            });
        });
    })
</script>

著者名  @taoka_toshiaki

Profile
高知県在住の@taoka_toshiakiです、記事を読んで頂きありがとうございます.
数十年前から息を吸うように日々記事を書いてます.たまに休んだりする日もありますがほぼ毎日投稿を心掛けています😅.
SNSも使っています、フォロー、いいね、シェア宜しくお願い致します🙇.
SNS::@taoka_toshiaki

タグ

API, appid, array, Bootstrap, dirname, extend, foreach, implode, MAService, obj, parse, plugins, strlen, success, 助動詞, 品詞, 形容動詞, 接尾辞, 接頭辞, 連体詞,

たった数行のプログラムでドツボにはまる。

2018.04.14

Logging

<?php
$command = "ls -m img";
exec($command,$val,$chk);
//imglist
$imglist = explode(",",implode("",$val));
if(is_array($imglist)){
    foreach ($imglist as $key => $value) {
        $img64[$key] = base64_encode(file_get_contents("img/".trim($value)));
        $path_parts = pathinfo($value);
        $path_parts['extension']=="jpeg"?"jpg":$path_parts['extension'];
?>
<div><a href="./img/<?=trim($value)?>"><?=$value?></a><br><img src="data:image/<?=$path_parts['extension']?>;base64,<?=$img64[$key]?>"></div>
<?php
    }
}
$obj["imglist"] = implode("\n\n",$img64);

ls -m というコマンドをPHPのexecという関数を使用し
画像リストを取得しようとしてどつぼにハマった・・・。
この関数、exec(“ls -m”)と書くと$valの中に配列として返却されるのだが、複数の配列に別れて返却される。なので一度、implodeを使用して一度、文字列に戻す必要がある。そしてカンマ区切りで再度、文字列分離する。

これでほっと一息つくとアウトだ!
配列化した値の前後に空白部分が入っていたり改行コードが入っていたりして画像を参照することが出来ないのだ。そのため、trim関数を使用して取り除く必要がある。

コマンドを使用して画像をリスト化して参照するメリットは何かと言えば数百枚の画像を列挙するときなどに高速で参照化することが出来るのだ。因みにコマンドでファイルの検索を行うという事なので本領発揮すると思います。

是非、お試しあれ。

著者名  @taoka_toshiaki

Profile
高知県在住の@taoka_toshiakiです、記事を読んで頂きありがとうございます.
数十年前から息を吸うように日々記事を書いてます.たまに休んだりする日もありますがほぼ毎日投稿を心掛けています😅.
SNSも使っています、フォロー、いいね、シェア宜しくお願い致します🙇.
SNS::@taoka_toshiaki

タグ

-Command, -m, , 39, 64, array, as, base, chk, contents, encode, exec, explode, extension, file, foreach, GET, gt, if, img, imglist, implode, is, jpeg, jpg, key, ls, lt, parts, path, pathinfo, php, quot, trim, val, value, ドツボ, プログラム, 数行,

無名関数、技術初歩垂れ流し。

2017.08.19

Logging


無名関数、技術初歩垂れ流しときます。
わからない人はわからないかもしれませんが、
分かる人にはわかるという・・・何ともそのまま何ですけどね。
無名関数を使うにあたってキーになるのは USEとcall_user_funcかな。
これさえ覚えとくと便利かもしれないなと思います。
習うより慣れよということでソースコード貼っときます。
じぶんの脳内は文字を読んで理解しているタイプではないので
図や絵柄など空間的な感覚でアルゴリズムを覚えています、なので
仕様書とか読んでもあまり頭に入ってくることがないのですね。
それよりかは、トライアンドエラーを繰り返して覚えるか、口頭などで
事細かに説明してもらったほうが、頭に入ってくることが多いです。
 

<?php
//無名関数1
$q = function($s){
    $ss = $s."FF15!!]]";
    return $ss;
};
define("ff",$q("[[ now on sale "));
//var_dump(ff);
//無名関数2
$hoge = ff;
$f = function() use ($hoge){
    return explode(" ",$hoge);
};
//var_dump($f());
//無名関数3
function mumei(){
    $m = 2222;
    $d = 22;
    return function() use ($m,$d){
      $a = $m * $d;
      return $a;
    };
}
$a = mumei();
//var_dump($a());
//無名関数4
if(is_array($s =
    call_user_func(function(){
        $r = [];
        for($i=0;$i<10;$i++){
            $r[$i] = $i;
        }
        return $r;
    })
)){
    //var_dump($s);
}
print(implode("<br>",explode("\n",'
string(23) "[[ now on sale FF15!!]]"
array(5) {
  [0]=>
  string(2) "[["
  [1]=>
  string(3) "now"
  [2]=>
  string(2) "on"
  [3]=>
  string(4) "sale"
  [4]=>
  string(8) "FF15!!]]"
}
int(48884)
array(10) {
  [0]=>
  int(0)
  [1]=>
  int(1)
  [2]=>
  int(2)
  [3]=>
  int(3)
  [4]=>
  int(4)
  [5]=>
  int(5)
  [6]=>
  int(6)
  [7]=>
  int(7)
  [8]=>
  int(8)
  [9]=>
  int(9)
}
')));

著者名  @taoka_toshiaki

Profile
高知県在住の@taoka_toshiakiです、記事を読んで頂きありがとうございます.
数十年前から息を吸うように日々記事を書いてます.たまに休んだりする日もありますがほぼ毎日投稿を心掛けています😅.
SNSも使っています、フォロー、いいね、シェア宜しくお願い致します🙇.
SNS::@taoka_toshiaki

タグ

$i&lt, AM, array, br&gt, call_user_func, function mumei, hoge, implode, int, now on sale FF15, return explode, return function, string, var_dump, アルゴリズム, トライアンドエラー, 仕様書, 技術初歩垂れ流し, 無名関数,

OK Google?からOK human?に。

2016.07.17

Logging


土曜日は雨だと言っていたのですが、土曜日の朝は
上天気でしたね。来週の後半は雨が降る模様です。雨が降るのを
期待しているわけではないのです。ただ、雨が降ると
過ごしやすいなと感じたりします。
今日のお題は「OK Google?からOK human?に。」です。
コードを書くことが仕事な自分ですが、結構な頻度で検索に頼ってます。
検索に頼りきっているわけでもないのですが、やはりメソッド名ぐらいは
覚えておいたほうが良いなと思います。自分の場合、いろいろな
言語にまたがって仕事や私用でコードを書くことがあるので
あやふや化している所があるのですが、仕事で使う言語ぐらい
覚えておいたほうが良いなと感じだしました。
検索って仕事をする中では非効率な作業の中に
入ると自分は思っています。そういう観点からもやはりいつも
使用するPHP言語は覚えておいて損はない気がします。
ちなみに良く使うメソッドでexplodeとimplodeがあります。
このメッソドは下記のような機能になりますが、
いままで、どちらがどの機能だったのかが曖昧でしたが
この頃、英語の意味から覚えたほうが早いと思い
片方を覚えたら、もう片方も覚えた次第です。
良く使うものから、徐々に検索離れをしようと思います。
どうなることか・・・。
(文字列を配列を分解する機能と配列を文字列化する機能)

著者名  @taoka_toshiaki

Profile
高知県在住の@taoka_toshiakiです、記事を読んで頂きありがとうございます.
数十年前から息を吸うように日々記事を書いてます.たまに休んだりする日もありますがほぼ毎日投稿を心掛けています😅.
SNSも使っています、フォロー、いいね、シェア宜しくお願い致します🙇.
SNS::@taoka_toshiaki

タグ

B00D3SKT0W, DVD BOX X, explode, implode, OK Google, OK human, コード, なるこ, メソッド, メッソド, 上天気, 土曜日, 文字列, 検索, 機能, 片方, 言語, 配列,