PHP 8.5.0 Alpha 4 available for testing

Voting

: one minus zero?
(Example: nine)

The Note You're Voting On

dmhouse at gmail dot com
17 years ago
Guillaume Paramelle's comments below are worth underlining: tempnam() will not accept a relative path for its first directory. If you pass it one, it will (on Windows XP at least) create the temporary file in the system temp directory.

The easiest way to convert a relative path to an absolute path is to prepend getcwd():

<?php
$file
= tempnam('files/temp', 'tmp'); // Wrong!
$file = tempnam(getcwd() . 'files/tmp', 'tmp') // Right.
?>

<< Back to user notes page

To Top