php 文字列の一部分を切り取る substr
2010 年 1 月 29 日
コメントはありません
参照元:http://zapanet.info/phpdoc/function.substr.html
参照元:http://zapanet.info/phpdoc/function.substr.html
以下のようにすることで、10文字ごとに “\n”で区切ることが出来ます。
A very
long
wooooooooo
ooord.
参照元:http://www.php.net/manual/ja/function.wordwrap.php
使用例
//パスワード生成クラス読み込み
require_once ‘My/Password.php’;
//デフォルトは8桁のパスワードが生成されます
$password = My_Password::getPassword();
var_dump($password);
//『32桁、小文字英字のみ』のパスワード生成
$password = My_Password::getPassword(32, ‘small’);
var_dump($password);
続きを読む…
最近のコメント