@@ 81-90 (lines=10) @@ | ||
78 | * |
|
79 | * @return string |
|
80 | */ |
|
81 | public function getExtension($fileName) |
|
82 | { |
|
83 | $lastDot = strrpos($fileName, '.'); |
|
84 | ||
85 | if (!$lastDot) { |
|
86 | return ''; |
|
87 | } |
|
88 | ||
89 | return substr($fileName, $lastDot + 1); |
|
90 | } |
|
91 | ||
92 | /** |
|
93 | * @param $fileName |
|
@@ 97-106 (lines=10) @@ | ||
94 | * |
|
95 | * @return string |
|
96 | */ |
|
97 | public function getNameWithoutExtension($fileName) |
|
98 | { |
|
99 | $lastDot = strrpos($fileName, '.'); |
|
100 | ||
101 | if (!$lastDot) { |
|
102 | return $fileName; |
|
103 | } |
|
104 | ||
105 | return substr($fileName, 0, $lastDot); |
|
106 | } |
|
107 | ||
108 | /** |
|
109 | * @param string $fileName |