Possible Duplicate:
Annoying PHP error: “Strict Standards: Only variables should be passed by reference in”
I have this line of code,
$extension=end(explode(".", $srcName));
when I fun my function I get
PHP Strict Standards: Only variables should be passed by reference in
I am not sure how to solve this
The function
end()requires a variable to be passed-by-reference and passing the return-value of a function doesn’t acheive this. You’ll need to use two lines to accomplish this:If you’re simply trying to get a file-extension, you could also use
substr()andstrrpos()to do it in one line:Or, if you know the number of
.‘s that appear in the string, say it’s only 1, you can uselist()(but this won’t work if there is a dynamic number of.‘s: