K.K Patel K.K Patel - 9 months ago 56
PHP Question

Declare Variable in PHP Script

In my PHP script following variable creates random filename.
I want to keep file name as


$jstack_file = trim(`mktemp`);

How can I do that?

Thanks in Advance.


Try with -

$filename = "jstack-" .time(). ".log";

Or if you need some particular datetime format -

$filename = "jstack-" .date('dmyHis'). ".log";