Авторизация
 Регистрация   Войти   Забыли пароль? 

file_name_ext() Функция определяет имя и расширение файла

Обновлённый PHP-Fusion Bogatyr / Free CMS PHP-Fusion 7 Bogatyr / PHP-functions for files upload and download / file_name_ext() Функция определяет имя и расширение файла


 Russian

file_name_ext Function defines the name and the file extension

Обновлённый PHP-Fusion Bogatyr / Free CMS PHP-Fusion 7 Bogatyr / PHP-functions for files upload and download / file_name_ext Function defines the name and the file extension


 English

PHP

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in F:\OpenServer\domains\php-fusion.vveb.ws\includes\bbcodes\mail_bbcode_include.php on line 20

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in F:\OpenServer\domains\php-fusion.vveb.ws\includes\bbcodes\mail_bbcode_include.php on line 21

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in F:\OpenServer\domains\php-fusion.vveb.ws\includes\bbcodes\search_bbcode_include.php on line 39
PHP
  1. <?php
  2. // This function defines the name and the file extension (eg 'puh.jpg'),
  3. // Returns an array with two values:
  4. // First - the name ("puh"),
  5. // The second - the file extension (".jpg").
  6. // Does not take into account the path of the file.
  7. // function Strtolower() works only with English file names. Without Russian letters.
  8. // Функция определяет имя и расширение файла (например 'puh.jpg'),
  9. // возвращая массив из 2 значений:
  10. // первое - название ("puh"),
  11. // второе - расширение файла (".jpg").
  12. // Никак не учитывает путь к файлу.
  13. // Функция strtolower() работают только с английскими именами файлов. Без русских букв.
  14. function file_name_ext($filename) {
  15.      // echo "<br> :: " . $filename; //  :: puh.jpg
  16.     $photo_name = strtolower(substr($filename, 0, strrpos($filename, ".")));
  17.     $photo_ext = strtolower(strrchr($filename, "."));
  18.      // echo "<br> :: " . $photo_name . "|" . $photo_ext ; // :: puh|.jpg
  19.     return array($photo_name, $photo_ext);
  20. }
  21. ?>
Добавить комментарий

Добавить комментарий
Пожалуйста, залогиньтесь для добавления комментария.
Рейтинги
HTML-code and BB-code for blogs and forums

<a href="https://php-fusion.vveb.ws/php-fusion.php?id=1">file_name_ext() Функция определяет имя и расширение файла</a>


[url=https://php-fusion.vveb.ws/php-fusion.php?id=1]file_name_ext() Функция определяет имя и расширение файла[/url]

Language: Default
 
Код для PHP-Fusion