PHP tempnam()関数
❮PHPファイルシステムリファレンス例
指定されたディレクトリに一意の名前の一時ファイルを作成します。
<?php
echo tempnam("C:\inetpub\testweb","TMP0");
?>
上記のコードの出力は次のようになります。
C:\inetpub\testweb\TMP1.tmp
定義と使用法
tempnam()関数は、指定されたディレクトリに一意の名前の一時ファイルを作成します。
注:指定されたディレクトリーが存在しない場合、tempnam()はシステムの一時ディレクトリーにファイルを生成する場合があります。
ヒント:tmpfile() 関数も参照してください。
構文
tempnam(dir, prefix)
パラメータ値
Parameter | Description |
---|---|
dir | Required. Specifies the directory of where to create the temp file |
prefix | Required. Specifies the start of the filename |
技術的な詳細
戻り値: | 新しい一時ファイル名、失敗するとFALSE |
---|---|
PHPバージョン: | 4.0以降 |
PHP変更ログ: |
❮PHPファイルシステムリファレンス