• <i id='Dtbat'><tr id='Dtbat'><dt id='Dtbat'><q id='Dtbat'><span id='Dtbat'><b id='Dtbat'><form id='Dtbat'><ins id='Dtbat'></ins><ul id='Dtbat'></ul><sub id='Dtbat'></sub></form><legend id='Dtbat'></legend><bdo id='Dtbat'><pre id='Dtbat'><center id='Dtbat'></center></pre></bdo></b><th id='Dtbat'></th></span></q></dt></tr></i><div id='Dtbat'><tfoot id='Dtbat'></tfoot><dl id='Dtbat'><fieldset id='Dtbat'></fieldset></dl></div>

    <small id='Dtbat'></small><noframes id='Dtbat'>

  • <legend id='Dtbat'><style id='Dtbat'><dir id='Dtbat'><q id='Dtbat'></q></dir></style></legend>

      <bdo id='Dtbat'></bdo><ul id='Dtbat'></ul>
    <tfoot id='Dtbat'></tfoot>

        php 上传时唯一的文件名

        时间:2023-12-02
          <bdo id='7ybcd'></bdo><ul id='7ybcd'></ul>

            <tfoot id='7ybcd'></tfoot>
            <legend id='7ybcd'><style id='7ybcd'><dir id='7ybcd'><q id='7ybcd'></q></dir></style></legend>
              <tbody id='7ybcd'></tbody>

            <i id='7ybcd'><tr id='7ybcd'><dt id='7ybcd'><q id='7ybcd'><span id='7ybcd'><b id='7ybcd'><form id='7ybcd'><ins id='7ybcd'></ins><ul id='7ybcd'></ul><sub id='7ybcd'></sub></form><legend id='7ybcd'></legend><bdo id='7ybcd'><pre id='7ybcd'><center id='7ybcd'></center></pre></bdo></b><th id='7ybcd'></th></span></q></dt></tr></i><div id='7ybcd'><tfoot id='7ybcd'></tfoot><dl id='7ybcd'><fieldset id='7ybcd'></fieldset></dl></div>

              <small id='7ybcd'></small><noframes id='7ybcd'>

                • 本文介绍了php 上传时唯一的文件名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我在我的网站上有一个带有图片上传的提交讨论表单.现在,我想在用户提交他们的图像时上传一个唯一的文件名,这样我就可以显示所有图像的结果,并且可以避免重复的文件名.

                  I've a submit discussion form with image upload in my website. Now, I want to upload a unique file name when the user submits their image so that I can show the result of all images and can avoid duplicate file names.

                  我怎样才能用 php 做到这一点?如果您需要我的表单处理代码,我会上传.

                  How can I do this with php? If you need my form process code then I'll upload it.

                  推荐答案

                  可以使用uniqid()函数生成唯一ID

                  You can use the uniqid() function to generate a unique ID

                  /**
                   * Generate a unique ID
                   * @link http://www.php.net/manual/en/function.uniqid.php
                   * @param prefix string[optional] <p>
                   * Can be useful, for instance, if you generate identifiers
                   * simultaneously on several hosts that might happen to generate the
                   * identifier at the same microsecond.
                   * </p>
                   * <p>
                   * With an empty prefix, the returned string will
                   * be 13 characters long. If more_entropy is
                   * true, it will be 23 characters.
                   * </p>
                   * @param more_entropy bool[optional] <p>
                   * If set to true, uniqid will add additional
                   * entropy (using the combined linear congruential generator) at the end
                   * of the return value, which should make the results more unique.
                   * </p>
                   * @return string the unique identifier, as a string.
                   */
                  function uniqid ($prefix = null, $more_entropy = null) {}
                  

                  这篇关于php 上传时唯一的文件名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:阻止上传可执行图像 (PHP) 下一篇:在 php 中的 mp4 =&gt;mp3 转换后更改 js/ajax 中的按钮文本

                  相关文章

                  <tfoot id='seHIS'></tfoot>
                    <bdo id='seHIS'></bdo><ul id='seHIS'></ul>
                    <legend id='seHIS'><style id='seHIS'><dir id='seHIS'><q id='seHIS'></q></dir></style></legend>
                  1. <small id='seHIS'></small><noframes id='seHIS'>

                  2. <i id='seHIS'><tr id='seHIS'><dt id='seHIS'><q id='seHIS'><span id='seHIS'><b id='seHIS'><form id='seHIS'><ins id='seHIS'></ins><ul id='seHIS'></ul><sub id='seHIS'></sub></form><legend id='seHIS'></legend><bdo id='seHIS'><pre id='seHIS'><center id='seHIS'></center></pre></bdo></b><th id='seHIS'></th></span></q></dt></tr></i><div id='seHIS'><tfoot id='seHIS'></tfoot><dl id='seHIS'><fieldset id='seHIS'></fieldset></dl></div>