elbarro
asked on
unexpected T_VARIABLE php
Im new to Classes in PHP and have a rather odd problem. Im getting an unexpected T_VARIABLE error. I've checked, double checked and triple checked any missing semi-colons, comas, etc and still nothing. Here is the code snipit:
Here is where I get the error:
(d is of type Directions and places is an array of Route objects)
echo "$d->getRoute($i)->getName ()";
if($dir == $d->getRoute($i)->getName( ))
{
echo "orange_text";
}
// code snippets
class Directions{
function getRoute($i){
return $this->places[$i];
}
}
class Route{
function getName(){
return $this->name;
}
}
Here is where I get the error:
(d is of type Directions and places is an array of Route objects)
echo "$d->getRoute($i)->getName
if($dir == $d->getRoute($i)->getName(
{
echo "orange_text";
}
// code snippets
class Directions{
function getRoute($i){
return $this->places[$i];
}
}
class Route{
function getName(){
return $this->name;
}
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER