• <small id='QekFT'></small><noframes id='QekFT'>

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

        <legend id='QekFT'><style id='QekFT'><dir id='QekFT'><q id='QekFT'></q></dir></style></legend>
      2. 删除文件上传时的文件扩展名

        Remove file extension on file upload(删除文件上传时的文件扩展名)

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

          <legend id='fHfDA'><style id='fHfDA'><dir id='fHfDA'><q id='fHfDA'></q></dir></style></legend>

              <tbody id='fHfDA'></tbody>
            <tfoot id='fHfDA'></tfoot>

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

              <bdo id='fHfDA'></bdo><ul id='fHfDA'></ul>
                  本文介绍了删除文件上传时的文件扩展名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我现在正在为一个网站编写代码,该网站上传图片,然后显示它们的画廊风格.我希望将图像的文件名作为图像的名称输入到站点的数据库中.但是,仅使用 $_FILES['images']['name']; 给了我文件名,但最后附加了文件扩展名.如何删除文件扩展名以便我可以单独使用文件名?

                  I'm writing the code for a website right now that's uploads images and then displays them gallery style. What I would like to happen is for the file name of the image to be entered into the site's database as the name of the image. However, just using $_FILES['images']['name']; gives me the file name but with the file extension attached at the end. How would I remove the file extension so I can use the file name by itself?

                  推荐答案

                  可以使用pathinfo()函数(文档).

                  $example  = "my_file.jpeg";
                  $filename = pathinfo($example, PATHINFO_FILENAME);
                  echo $filename; // my_file
                  

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

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

                  相关文档推荐

                  PHP Upload File Validation(PHP 上传文件验证)
                  PHP Error - Uploading a file(PHP 错误 - 上传文件)
                  How can I write tests for file upload in PHP?(如何在 PHP 中编写文件上传测试?)
                  php resizing image on upload rotates the image when i don#39;t want it to(php在上传时调整图像大小会在我不想要它时旋转图像)
                  How to send additional data using PLupload?(如何使用 PLupload 发送附加数据?)
                  change button text in js/ajax after mp4 =gt;mp3 conversion in php(在 php 中的 mp4 =gt;mp3 转换后更改 js/ajax 中的按钮文本)
                  <tfoot id='ApTc9'></tfoot>
                    <tbody id='ApTc9'></tbody>
                  <legend id='ApTc9'><style id='ApTc9'><dir id='ApTc9'><q id='ApTc9'></q></dir></style></legend>
                    <bdo id='ApTc9'></bdo><ul id='ApTc9'></ul>
                    • <small id='ApTc9'></small><noframes id='ApTc9'>

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