
MacのVSCode(VisualStudioCode)のClineでOllamaが動作しない時の解決備忘録
2024.11.13

WordPressでメディアのサムネイルを一括で再生成するプラグイン『Regenerate Thumbnails』
2023.09.23

MacでOpen Interpreterをローカルで動かした際に、CodeLlama Modelがダウンロードされる場所
2023.09.09
Category PHP Update 2010.01.21
PHPの初歩です。
PHPでディレクトリの操作をする場合、ディレクトリごと、
ごっそり削除したいという場合があると思います。
PHP Manualから引用します。
functionを下記のように設定し
<?php function remove_directory($dir) { if ($handle = opendir("$dir")) { while (false !== ($item = readdir($handle))) { if ($item != "." && $item != "..") { if (is_dir("$dir/$item")) { remove_directory("$dir/$item"); } else { unlink("$dir/$item"); echo " removing $dir/$item<br>\n"; } } } closedir($handle); rmdir($dir); echo "removing $dir<br>\n"; } } ?>
任意の場所から
呼び出せばOK
remove_directory("ディレクトリへのパス");