A community in which webmasters can ask for help with topics such as PHP coding , MySQL , IT jobs, web design, IT security.
Current location:homephp forumphp talk in 2009 yearProlem with if function - page 1
User InfoPosts
Prolem with if function#1
something seems to be wrong with the first line of this if function, seems alright to me though.

if ($count1 == sizeof($map) && $count2 == sizeof($map[0])){
echo ";";
}else{
echo ",";
}


This is the error I get (line 36 is the first line of the above line.)

Parse error: parse error in C:\wamp\www\game\mapArrayConvertor.php on line 36


EDIT: The OP notes in an answer below that the error was a missing semi-colon on line 35 and not the code included in the question.

posted date: 2009-04-10 04:44:00


Re: Prolem with if function#2
I had made out the solution of this problem. click to view my topic...

hope that hepls.

posted date: 2009-04-10 04:44:01


Re: Prolem with if function#3
What is wrong with it? Are you seeing an error when you run it?

posted date: 2009-04-10 04:46:00


Re: Prolem with if function#4
There appears to be nothing wrong with the syntax of your code. If the behavior is not what you expect, please post more details regarding the value of the variables and the intended and actual behavior of the code.

posted date: 2009-04-10 04:48:00


Re: Prolem with if function#5
I don(t see anything wrong with the code you have posted, so chances are the error is on a previous line. Perhaps a missed semicolon? Mismatched braces or parentheses?

posted date: 2009-04-10 04:49:00


Re: Prolem with if function#6
check the line 35, it could be that line is wrong.

posted date: 2009-04-10 04:50:00


Re: Prolem with if function#7
ghastly formatting to if this is what is actually looks like in your app. Good formating helps prevent errors - put brackets around each subclause in the if and use a recognised bracket layout (not }else{ on the same line)

posted date: 2009-04-10 04:51:00


Re: Prolem with if function#8
and indent those echo statements

posted date: 2009-04-10 04:52:00


Re: Prolem with if function#9
the wrong way, in other words

posted date: 2009-04-10 04:53:00


Re: Prolem with if function#10
Seems I missed a ";" on line 35, sorry guys.

posted date: 2009-04-10 04:54:00


Re: Prolem with if function#11
You could try:if (($count1 == sizeof($map)) && ($count2 == sizeof($map[0]))){ //blabla}

posted date: 2009-04-10 04:56:00


Re: Prolem with if function#12
I prefer the ().... as well.

posted date: 2009-04-10 05:08:00


select page: « 1 2 »
Copyright ©2008-2017 www.momige.com, all rights reserved.