PHP parse error - please point out the coding horror

irishmuscle9

New Member
Here is the code:Class_view.php contains the class definition as an associative array:\[code\]class View { private $viewArray=array(); function getViewArray() { return $this->viewArray; } function addToViewArray($key,$value){ $this->view[$key]=$value; }}\[/code\]In Index.php I have:\[code\]$view=new View();$view->addToViewArray("title","Projet JDelage");// Much more codeinclude ("UI_Header.php");\[/code\]And the code that causes the error is in UI_Header.php, arount the "title" HTML tags:\[code\]<?php echo '<?xml version="1.0" encoding="utf-8"?>'?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr"> <head> <title><?php echo htmlspecialchars($view->getViewArray()['title']);?> </title> <link rel="stylesheet" media="screen" type="text/css" title="StyleSheetProjet" href="http://stackoverflow.com/questions/3718942/StyleSheetProjet.css" /> </head>\[/code\]I'm trying to get the value associated with the key 'title' to show here.The error I get is:Parse error: parse error in Header.php on line 7Thank you,JDelage
 
Back
Top