H
H
hellcaster2018-03-16 21:45:35
PHP
hellcaster, 2018-03-16 21:45:35

Not uploading a file?

What's wrong with this code?

$img_errors = array();
$file_name = $_FILES["image"]['name'];
$file_size = $_FILES["image"]['size'];
$file_tmp = $_FILES["image"]['tmp_name'];
$file_type = $_FILES["image"]['type'];
$file_ext = strtolower(end(explode('.', $_FILES["image"]['name']))); //W:\domains\blog.loc\setting.php on line 11

if this is issued
Notice: Only variables should be passed by reference in W:\domains\blog.loc\setting.php on line 11

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Lazy @BojackHorseman PHP, 2018-03-16
@web_Developer_Victor

it's written.
only variable mixed end ( array &$array ) can be passed by reference

$tmp = explode('.', $_FILES["image"]['name']);
$file_ext = strtolower(end($tmp));

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question