K.K Patel K.K Patel - 2 years ago 124
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.

Answer Source

Try with -

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

Or if you need some particular datetime format -

$filename = "jstack-" .date('dmyHis'). ".log";
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download