Question mark? (wow, so meta)

Toodles, y’all! o/

So I recently started coding in PHP, and I’ve run into a little error with some code I’m trying to execute:

Parse error: syntax error, unexpected '?' in /Applications/XAMPP/xamppfiles/htdocs/test1.php on line 2

No worries, right, just a simple case of finding the error in the code and figuring out what went wrong from the documentation?

Only, there is no question mark on line 2. [:S]

<?php $username = “Da Fanatic”; echo $username; echo “<br>”; $current_user = $username; echo $current_user; ?>

Can anyone shed some light on the matter (Gah, Meet The Robinsons reference…)? I can give virtual cookie in exchange… [:P]

Your funky quotes are messing it up. You’re not using Word for an editor are you?

Try this:

[php] <?php
$username = “Da Fanatic”;
echo $username;
echo “
”;
$current_user = $username;
echo $current_user;
?>[/php]

Huh, that seemed to work. O.o I was using Unitron to edit the code - maybe I should stick to plain text in Textedit.

Thanks for the help! [:D] Here’s the virtual cookie. (•‿•)-❂

Sponsor our Newsletter | Privacy Policy | Terms of Service