mirror of
https://github.com/alrayyes/wiki.git
synced 2024-11-22 11:36:23 +00:00
21 lines
431 B
Markdown
21 lines
431 B
Markdown
---
|
|
date: 2020-11-16
|
|
id: 030ab7e7-9b0f-4be2-8a62-28b82640ddb7
|
|
title: tempnam()
|
|
---
|
|
|
|
# Description
|
|
|
|
Like the PHP `tempnam()` function this method creates a file with a
|
|
unique name in the given directory.
|
|
|
|
# Syntax
|
|
|
|
``` php
|
|
use Symfony\Component\Filesystem\Filesystem;
|
|
|
|
$fs = new Filesystem();
|
|
|
|
$fs->tempnam('/tmp', 'report_'); // '/tmp/report_Um3nlH'
|
|
$fs->tempnam('/tmp', 'report_', '.pdf'); // '/tmp/report_Um3nlH.pdf'
|
|
```
|