php object が count や sizeof でカウントできないとき

echo sizeof($object) でエラーのときは echo sizeof((array)$object) とするとカウントできる。

インスタグラム内ブラウザでPayaplボタンが動作しない時の対処方法

https://www.paypal-community.com/t5/Merchant-Products-and-Services/Paypal-button-not-working-in-Instagram-in-app-browser/td-p/1643344
formタグ内の method を post から add に変更
user_agent などから instagram の判別を行い、サーバーサイドスクリプト、またはjavascript などで設定させる。

php 関数 トレース

https://www.php.net/manual/en/function.debug-backtrace.php

javascript xmlhttprequest post & get json data バージョン

post して、Get でjson 形式での値も取得の場合
let xmlHttpRequest = new XMLHttpRequest();
xmlHttpRequest.responseType = ‘json’;
xmlHttpRequest.onreadystatechange = function(){
if(this.readyState == 4 && this.status == 200){
//user = this.response;
console.log(this.response);
// alert(this.response[1].getid);
} else {
console.log(this.readyState + ” ” + this.status);
}
}
xmlHttpRequest.onloadstart = function(){ console.log(‘onloadstartイベント’); }; // same as xhr.readyState === 1
xmlHttpRequest.onprogress = function(){ console.log(‘onprogressイベント’); }; // same as xhr.readyState === 3
xmlHttpRequest.onload = function(){ console.log(‘onloadイベント’); }; // xhr.readyState === 4
xmlHttpRequest.onabort = function(){ console.log(‘onabortイベント’); };
xmlHttpRequest.onerror = function(){ console.log(‘onerrorイベント’); };
xmlHttpRequest.ontimeout = function(){ console.log(‘ontimeoutイベント’); };
// post だけど、getをしながらもデータが取れる。
xmlHttpRequest.open(“POST”, “unknowncasts.php?getid=1234&getid2=2334”, true);
xmlHttpRequest.setRequestHeader(‘Content-type’, ‘application/x-www-form-urlencoded’);
xmlHttpRequest.send(“fullname=” + fullname + “&id=” + id);
// get version
xmlHttpRequest.open(“GET”, “unknowncasts.php?getid=1234&getid2=2334”, true);
xmlHttpRequest.setRequestHeader(‘Content-type’, ‘application/x-www-form-urlencoded’);
xmlHttpRequest.send();

reCAPTCHA ログインページ

https://www.google.com/recaptcha/admin/

Mac Virtual Box Vagrant Apache MariaDB PHP Node.js Express

Vagrant の基本設定方法
Archive

phpmyadmin をターミナルから変更

vagrant centos7.8 環境
phpMyadminに入ってからも設定から変更ができるが、キャッシュが切れると元に戻るので、vi /etc/phpMyAdmin/config.inc.php から変更
左ナビをグループ化しない

$cfg[‘NavigationTreeEnableGrouping’] = false;

左ナビのデータベース内のテーブル表示数を変更

$cfg[‘MaxNavigationItems’] = 100;

データベースのエクスポート・インポート without phpMyAdmin

mysqldump -u root -p attob_dbattob | gzip > attob_dbattob.dump.gz

データベースを作成後に

zcat attob_dbattob.dump.gz | mysql -u root -p attob_dbattob

もし、途中でエラー等が出た場合は virtualboxのメモリを増やす。

linux centos cp で 無理やり上書き

cp の前にバックスラッシュ \cp とする。

mac ターミナルで 大量 mv

find ./ -name “*” -exec mv -n {} ../jpg6/ \;

アスタリスク * を ダブルクォートでくくると Argument list too long が出ない。
../jpg6 は移動先