Thanx I got it to work, however, I have no idea why it works now considering
I did nothing different:
$singleProfileHTML .= "<!--\n";
foreach ($profileArray[$i][attributes] as $key => $val) {
$singleProfileHTML .= strtolower($key) . '="' . str_replace("'",
''', str_replace('"', '"', stripslashes($val))) . "\"\n";
}
$singleProfileHTML .= "-->\n";
Beats the heck out of me!
Phil
----- Original Message -----
From: "David Otton" <[EMAIL PROTECTED]>
To: "Phil Powell" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, July 11, 2003 2:48 AM
Subject: Re: [PHP] What did I do wrong to cause a parse error?
> On Fri, 11 Jul 2003 00:53:32 -0400, you wrote:
>
> >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?
>
> Line 1 - attributes should have a $ in front of it, or be a string
literal.
>
> BTW, that's a really nasty line. Maybe it would be easier to read as :
>
> foreach ($profileArray[$i][$attributes] as $key => $val) {
> $val = str_replace('"', '"', $val);
> $val = str_replace("'", ''', $val);
> $singleProfileHTML .= "$key=\"$val\"\n";
> }
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php