syntax error - PHP code working in PHP5, but not 4 -


this code of mine working in php5, not 4, , have no clue why

function now(){     return intval(             explode(' ', microtime() )[1] // line 9            ) * 100             +            intval(             explode(' ', microtime() )[0]            * 100            ); } 

(the odd indentation me see if find wrong.)

php parse error:  syntax error, unexpected '[' in /a/b/c on line 9 

anybody see anything?

php4 has no array dereferencing. can't explode(' ', microtime() )[1].

you need use temp variable.

function now(){     $time = explode(' ', microtime() );     return intval(             $time[1] // line 9            ) * 100             +            intval(             $time[0]            * 100            ); } 

Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -