Quote:
Originally Posted by DJ29Joesph
I was coming across some code and was in poll.php and I think I found an error in the php file.
|
It looks correct to me. I'll use quote instead of code, so I can highlight the pairs:
Quote:
$allnames["$name[voteoption]"]
[] = '<a href="member.php?'
. $vbulletin->session->vars['sessionurl']
. "u=$name[userid]\">$name[musername]</a>";
|
In each line of the quote above, the opening and closing quotes are highlighted in red.
The one that's throwing you off is the green one, preceeded with a backslash. The backslash indicates to PHP to "keep this intact, don't interpret it as code". This needs to be done when including a double-quote character within double-quote marks.
The double-quote before member.php (line 2 in quote above) doesn't need a backslash in front of it because it's not inside a pair of double-quotes, it's inside single quotes. Hence the difference.
Refer to php.net for further information.