-3

I have this PHP function :

function DIGITAL_SIGN($len = 8){
  $charset = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
  $base = strlen($charset);
  $result = '';

  $now = explode(' ', microtime())[1]; // ERROR
  while ($now >= $base){
    $i = $now % $base;
    $result = $charset[$i] . $result;
    $now /= $base;
  }
  return substr($result, -8);
}

In action, I see This Error in my page :

Parse error: syntax error, unexpected '[' in /class/functions.php on line 163

how do can i Fix this?

Perspolis
  • 862
  • 3
  • 11
  • 28

1 Answers1

4

update your php version or use old school

$now = explode(' ', microtime());
$now = $now[1];
donald123
  • 5,638
  • 3
  • 26
  • 23