Parse error: syntax error, unexpected on line 36

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
flyingcow93g
Forum Newbie
Posts: 2
Joined: Sat Mar 13, 2010 8:57 am

Parse error: syntax error, unexpected on line 36

Post by flyingcow93g »

$matches = make_array(get_matches($teamnumber, {$event[0]["eventid"]}));

Parse error: syntax error, unexpected '{' in /home/flyingco/public_html/team_info.php on line 36

Can't figure out whats wrong with that...

code:

http://pastebin.com/XfunYQy1

Its my first time using php so its probably something stupid...
User avatar
McInfo
DevNet Resident
Posts: 1532
Joined: Wed Apr 01, 2009 1:31 pm

Re: Parse error: syntax error, unexpected on line 36

Post by McInfo »

When posting code, please use the syntax so it looks like this:

Code: Select all

$matches = make_array(get_matches($teamnumber, {$event[0]["eventid"]}));
To answer your question, remove the curly braces. Curly braces are used around variables only when they appear in strings.

Code: Select all

$matches = make_array(get_matches($teamnumber, $event[0]["eventid"]));
Edit: This post was recovered from search engine cache.
Last edited by McInfo on Thu Jun 17, 2010 5:29 pm, edited 1 time in total.
flyingcow93g
Forum Newbie
Posts: 2
Joined: Sat Mar 13, 2010 8:57 am

Re: Parse error: syntax error, unexpected on line 36

Post by flyingcow93g »

Thanks.

Now,

Code: Select all

$yearevents[0]["eventid"]
is an array. I do I count the amount of "eventid" in it? I tried

Code: Select all

count($yearevents[0]["eventid]"))
but didn't get it..
cpetercarter
Forum Contributor
Posts: 474
Joined: Sat Jul 25, 2009 2:00 am

Re: Parse error: syntax error, unexpected on line 36

Post by cpetercarter »

Just remove "{" and "}" from line 36.
Post Reply