// Random bytes
// $private_key = bin2hex(openssl_random_pseudo_bytes(32));
// But using brainwallet.org style to have easy comparison
$passphrase = "correct horse battery staple";
$private_key = hash('sha256', $passphrase);
var_dump ("PrivKey: $private_key");
// Bitcoin::privKeyToWIF from github.com/mikegogulski/bitcoin-php
$wif = Bitcoin::privKeyToWIF($private_key);
var_dump ("WIF PrivKey: $wif");
// And now I don't know where to even start ...