ebolt007 Posted May 7, 2010 Share Posted May 7, 2010 I'm getting a parse error on line 302: Parse error: syntax error, unexpected '[' in /home/bhharley/public_html/newsite2/calendar/admin.php on line 302 Line 302 is $day = getdatefromcalendarformat( $_REQUEST['dt'] )[2]; If I take out the [2] it works, but the calendar I'm working on breaks of course. How do I fix this? Quote Link to comment Share on other sites More sharing options...
Alex Posted May 7, 2010 Share Posted May 7, 2010 Unfortunately, you can't access members of an array returned from a function like that. $day = getdatefromcalendarformat( $_REQUEST['dt'] ); $day = $day[2]; Quote Link to comment Share on other sites More sharing options...
ebolt007 Posted May 7, 2010 Author Share Posted May 7, 2010 Great thanks, that fixed that but now I have one more error. Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/bhharley/public_html/newsite2/calendar/admin.php on line 575 here's the line $_REQUEST['dt'] = strtotime( $year."-".$month * 1."-".$day ); Thanks in advance. Quote Link to comment Share on other sites More sharing options...
Alex Posted May 7, 2010 Share Posted May 7, 2010 If you wanted to do that you'd need to put the math inside of parenthesis: $_REQUEST['dt'] = strtotime( $year."-".($month * 1)."-".$day ); But what's the point of multiplying $month by 1 anyway? Quote Link to comment Share on other sites More sharing options...
ebolt007 Posted May 7, 2010 Author Share Posted May 7, 2010 Awesome thanks, that fixed it as well. Not sure why it's multiplying by one, I'm decoding it to figure that out. It's a calendar I downloaded and am trying to figure out, was just stuck on those 2 areas. Thanks a lot. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.