PHP unix ディレクトリの通常ファイル個数を調べる
2010年02月17日(水)
unixのコマンドがphpで使える事すら危うかったです。
すごく損した気分です。
ありがとうございました。
http://shoyu-ramen23.jugem.jp/?eid=190
$target_dir = '/var/www/public_html/test/images/'; //コマンドの実行結果を受け取る配列 $result = array(); $command = "find " . $target_dir . " -type f | wc -l"; exec($command, $result); //出力 echo '通常ファイル数は、' . $result[0];
find /var/www/public_html/test/images/ -type f | wc -l
というコマンドを送っているんですね。
関連記事
- PHP unix ディレクトリの通常ファイル個数を調べる
- htaccessでinclude_pathを設定
- MDB2 結果の行数取得numRows()
- PHP array_mergeについて
- PHP メールを送る
- AS3 県の定義クラス PrefList
- MDB2 データ取得
- Smarty テンプレート内でPHPを使うのはダメ!
- AS3 fl.transitions
- HTML5 canvas一歩め
- jQuery load時の第2引数に注意
- AS3 TweenerのsetTimeScaleを試すつもりが
- jQuery はじめてのjQueryプラグイン(駄作)
- jQuery 要素の順番を調べるため、またindex()をつかう
- PHP splintfはよく使うはず