0

I'm getting the following error:

Strict Standards: Only variables should be passed by reference in /home/bridgesh/public_html/includes/functions/html_output.php on line 45

From the following lines of code:

44. while ($val = current($new_get)){
45.     if($val==end(array_reverse ($new_get)) )$new_getstr.='?'.key($new_get).'='.$val;
46.     else $new_getstr.='&'.key($new_get).'='.$val;
47.     next($new_get);     
48. }

I've read through similar questions & answers on the subject here, but cannot figure out how to break the line down correctly.

Niet the Dark Absol
  • 320,036
  • 81
  • 464
  • 592
pedro42
  • 11
  • 2
  • 2
    _“but cannot figure out how to break the line down correctly”_ – to actually break it down into multiple lines, so that you can find out which of the statements used there actually causes the error, would be a start. – CBroe Oct 08 '13 at 14:16

2 Answers2

0

end works on a reference to an array, so it expects a variable, that contains an array array_reverse ($new_get) however is not a variable, but a function call You have to do:

   $reversed = array_reverse ($new_get)
   if($val==end($reversed) )$new_getstr.='?'.key($new_get).'='.$val;
Maxim Krizhanovsky
  • 26,265
  • 5
  • 59
  • 89
-1

Try this:

$new_getstr = http_build_query($new_get);

Documentation

Niet the Dark Absol
  • 320,036
  • 81
  • 464
  • 592