How to use tempnam in PHP

In this article I am going to explain about tempnam function in PHP.
  • 1490

PHP tempnam() Function

The filesystem tempnam function create file with unique file name.

Syntax of tempnam function

tempnam(dir, prefix)

Parameters in tempnam function

It have two parameter:

Parameter Description
dir It specifies the directory of where to create the temp file.
prefix It specifies the start of the filename.

Example of filesystem tempnam function

<html>

<body>

<?php

echo tempnam("C:\wamp\www\Dinesh","TempFile");

?>
</body>

</html>


Output:

tempnam-php.jpg

You may also want to read these related articles :
here

Ask Your Question 

Got a programming related question? You may want to post your question here

Programming Answers here

Categories

More Articles

© 2020 DotNetHeaven. All rights reserved.