} else { if ($this->start->getCoord() == $coord) { $html .= '<span class="start">' . $text . '</span>'; } else { if ($this->end->getCoord() == $coord) { $html .= '<span class="end">' . $text . '</span>'; } else { if (in_array($coord, $path)) { //$target = $this->path[$coord]; //$text = $target->getF() . '-' . $target->getG() . '-' . $target->getH(); $html .= '<span class="path">' . $text . '</span>'; } else { $html .= '<span>' . $text . '</span>'; } } } } } $html .= '</li>'; } $html .= '</ul>'; } return $html; } } $options = array('barrier' => array('2,5', '3,5', '4,5', '5,5', '6,5', '7,5', '8,5', '9,5'), 'start' => '5,3', 'end' => '5,9'); $graph = new Graph($options); $graph->createMap(); $graph->find(); echo $graph->displayMap();