-1

I got thie warnig: PHP Strict Standards: Only variables should be passed by reference

and the code:

if ((isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) &&
array_shift(explode(';', $_SERVER['HTTP_IF_MODIFIED_SINCE'])) == $gmt_mtime)

the second line code is the error one.

user2406612
  • 51
  • 1
  • 5

3 Answers3

0

I think you'll have to separate the array_shift and explode - something like this.

    $arr_gmt_mtime=explode( ';', $_SERVER['HTTP_IF_MODIFIED_SINCE'] );
    if ( ( isset( $_SERVER['HTTP_IF_MODIFIED_SINCE'] ) && array_shift( $arr_gmt_mtime ) == $gmt_mtime )
Professor Abronsius
  • 33,063
  • 5
  • 32
  • 46
0

Get the value of explode(';', $_SERVER['HTTP_IF_MODIFIED_SINCE']) within a variable and pass it within your array_shift like as

$arr = explode(';', $_SERVER['HTTP_IF_MODIFIED_SINCE']);
if ((isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) && array_shift($arr) == $gmt_mtime)
Narendrasingh Sisodia
  • 21,247
  • 6
  • 47
  • 54
0

First of all you need to explode $_SERVER['HTTP_IF_MODIFIED_SINCE'] with ";" and than you can use it in array_shift function.

<?
$exploded = explode(";",$_SERVER['HTTP_IF_MODIFIED_SINCE']);
if ((isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) && array_shift($exploded) == $gmt_mtime))
?>

Side Note: I don't know its a typo error or not, well u need to add one ending ")" in if condition as well otherwise you will get the PARSE ERROR.

devpro
  • 16,184
  • 3
  • 27
  • 38