Jump to content


Photo

PHP Strict Standards: Only variables should be passed by reference

variables

  • Please log in to reply
1 reply to this topic

#1 desception

desception
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 09 October 2014 - 11:39 PM

Hello guys, not sure why I keep getting this error, can anyone help me? Here is the code:

$ext=end(explode('.',$thum));


#2 requinix

requinix
  • Administrators
  • Maddening Administrator
  • 9,561 posts
  • LocationWA

Posted 10 October 2014 - 12:34 AM

Only recent versions of PHP (5.5+ I think) allow you to pass a non-variable to end(). If you're running an earlier version then you need a temporary variable.

But there's a better way to get file extensions:
$end = pathinfo($thum, PATHINFO_EXTENSION);

The Reimann Zeta Function Trolley Problem | "Summer is when I, the great ice fairy, can show my true power!"




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users