RE: [PHP] What did I do wrong to cause a parse error?

From: Date: Fri, 11 Jul 2003 09:18:25 +0000
Subject: RE: [PHP] What did I do wrong to cause a parse error?
Groups: php.general 
Request: Send a blank email to php-general+get-154841@lists.php.net to get a copy of this message
> -----Original Message----- > From: Phil Powell [mailto:soazine@erols.com] > Sent: 11 July 2003 05:54 > > foreach ($profileArray[$i][attributes] as $key => $val) { > $singleProfileHTML .= $key . "=\"" . str_replace("'", > ''', str_replace('"', '"', $val)) . > "\"\n"; > } > > The parsing error occurs in the "$singleProfileHTML.." line. > I'm completely don't get it; I see absolutely nothing wrong > with this, what did I miss? Well, I can see nothing wrong with that line, so I can't help there. I do, however, wonder why you aren't using htmlentities() instead of those two ugle str_replace()s. And I hope you have a constant defined called attributes, otherwise that array index must be either quoted (e.g. 'attributes'), or $attributes. Cheers! Mike --------------------------------------------------------------------- Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning & Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: m.ford@lmu.ac.uk Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211

« previous php.general (#154841) next »