|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Can't find error
Where am I going wrong with this statement:
Code:
if (subfind($row[namefind($array[0], $FilterColumn)], $FilterTerm) == $Include)
{
//stuff
}
Here is the error: Code:
PHP Parse error: syntax error, unexpected '(', expecting ']' in C:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs\\########.php on line ##
__________________
This is my sig. |
|
#2
|
||||
|
||||
|
Well I was wrong.
It seems to have something to do with: $row[namefind($array[0], $FilterColumn)] Can't quite pick it out without more code.
__________________
Last edited by acidfourtyfive : July 3rd, 2009 at 02:14 PM. |
|
#3
|
||||
|
||||
|
which part do you want?
|
|
#4
|
||||
|
||||
|
The error isn't in the code you posted. Post the 10 lines that come before it.
|
|
#5
|
||||
|
||||
|
found the error. You were right the first time, can't use a function as array key
|
|
#6
|
||||
|
||||
|
What version of PHP are you using? In 5.2 there is nothing that prevents you from using a function (return value) as an array key.
Last edited by E-Oreo : July 4th, 2009 at 12:01 AM. |
|
#7
|
||||
|
||||
|
Quote:
Functions as array keys seem to work fine in PHP 4 even with my simple test: Code:
kicken@bonzi:~$ php -v
PHP 4.4.9 (cli) (built: Jul 4 2009 02:53:09)
Copyright (c) 1997-2008 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
kicken@bonzi:~$ php -r '$a=array(); $a[max(5,6)] = "hello"; var_dump($a);'
array(1) {
[6]=>
string(5) "hello"
}
__________________
Spidermonkey Tutorial; Fight me: http://aoeex.mybrute.com http://www.aoeex.com/gmap.php - Put yourself on the map (Now Updated!) |
|
#8
|
||||
|
||||
|
This is what you are doing: You are asking "I can't feel my foot, here is a picture of it. What's wrong?" But what you fail to do is take a picture of your whole leg. If you had taken that picture, we'd see you have your leg blown off.
I somehow doubt you found the error. I think you just got really lucky, like I'm gonna do tonight! Can I get an amen?
__________________
Ryon's Laws of Stupidity:
Last edited by ryon420 : July 4th, 2009 at 03:21 AM. |
|
#9
|
||||
|
||||
|
-.- I put the erroneous statement in a variable assignment, and the problem disappeared. Interpret that how you will.
BTW: Some might consider it cocky that you assume I absolutely need your help, as opposed to looking for some friendly advice. P.S.: 5.2.10 |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > PHP Development > Can't find error |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|