Notice: Undefined index: extension in /var/www/.. on line 187
//185 - $f_name = $this->filename;
//186 - $path_parts = pathinfo($f_name);
//187 - $file_ext = $path_parts['extension'];
After some googleing I've seen alot of Isset being used. But I'm in doubt, about how to use it, in this case? Is it even going to solve the problem?
Yes, you can use isset
in this case. You first check if the key is set before trying to access it. I would use the ternary operator to set a default value if you need to.
$file_ext = isset($path_parts['extension']) ? $path_parts['extension'] : null;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With