How to create a string equivalent to yyyyMMddHHmmssffff in PHP?
<p>I'm trying to integrate with some VB code that uses DateTime.Now.ToString("yyyyMMddHHmmssffff") to generate a string. </p>
<p><code>DateTime.Now.ToString("yyyyMMddHHmmssffff")</code></p>
<p>The closest I can get to this in PHP is: </p>
<p><code>date('YmdHis')</code></p>
<p>But this is missing the millisecond part. </p><p>I have tried using microtime, for example: </p><p><code></code></p>
<p><code>date('YmdHis',time()).substr(str_replace(".","",microtime(true)),10,17)</code></p>
<p>But sometimes this results in a shorter string. </p>