I am trying to grab the extension of an uploaded file and echo it back on my page.
$file_name = $_FILES['profile_pic']['name'];
$file_extn = end(explode('.', $file_name));
$file_temp = $_FILES['profile_pic']['tmp_name'];
echo $file_extn;
The error I am receiving is
Strict Standards: Only variables should be passed by reference in C:\xampp\htdocs\reptile_forum+help\includes\widgets\logged_in.php on line 67.
Line 67 is the "$file_ext ="
Am I not using end()
properly? Is there something else I can use to get me the same result?
Note: The array displays perfectly when I remove end()
and use print_r()
, it just seems as though end()
isn't registering the array or something like that.