• <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 上传时唯一的文件名

        php Unique filename when uploading(php 上传时唯一的文件名)
          <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 上传时唯一的文件名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                  PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                  mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                  Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                  Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                  Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)

                  <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'>

                          <tbody id='seHIS'></tbody>
                      • <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>