Home  >  Article  >  Backend Development  >  Get the suffix name of the uploaded file and unify the upper and lower case of the file name

Get the suffix name of the uploaded file and unify the upper and lower case of the file name

WBOY
WBOYOriginal
2016-07-25 08:48:232351browse
  1. Get file suffix
  2. Upload file:
  3. if(!empty($_POST["sub"])){
  4. $a = strrev($_POST["text"]); // Reverse the string
  5. $b = explode(".",$a); //Split the string with a period
  6. $c = strrev($b[0]);
  7. echo "The file suffix is: .$c" ."
    ";
  8. }
  9. ?>
  10. session_start();
  11. if(!empty($_POST["sub"])){
  12. echo "The file name is automatically converted to uppercase: ".strtoupper($_POST["text"])."
    ";
  13. echo "The file name is automatically converted to lowercase:".strtolower($_POST["text"])."
    ";
  14. }
  15. ?>
Copy code


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn