使用例
//パスワード生成クラス読み込み
require_once 'My/Password.php';
//デフォルトは8桁のパスワードが生成されます
$password = My_Password::getPassword();
var_dump($password);
//『32桁、小文字英字のみ』のパスワード生成
$password = My_Password::getPassword(32, 'small');
var_dump($password);
…
$img_path // 取得する画像のパス(URL)
$path = “ここは保存先のパス”; // /home/ドメイン/public_html/imagesなど
$img = file_get_contents($img_path) ;//画像を取得
$fullpath = $path.basename($img_path);//画像の保存フルパス
file_put_contents($fullpath, $img);//保存。
*basename >> パス中のファイル名の部分を返す
graffiti on the web
この投稿へのコメント
コメントはまだありません。