|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
parse error doubt
Hi guys,
May i know whats wrong with my code ? code: $reference = "<a name=\""".$row['bookmark'].""\"></a>"; I am actually trying to output the php as: <a name="value"></a> in my file.. please advise. |
|
#2
|
||||
|
||||
|
too many double quotes...
try this: $reference = "<a name=\"".$row['bookmark']."\"></a>"; |
|
#3
|
|||
|
|||
|
thanks for your advise...
Another thing i wanna ask is, why we can use two time open and close doube quotes ? I was told that i can't do that.. e.g: echo "hehe "$_REGISTER['name']". How are you " <- i can't do this right ? and i was told i should use: echo 'hehe "$_REGISTER['name']". How are you' but this seems working: "<a name=\"".$row['bookmark']."\"></a>"; May i know when actually i can't use double quote twice and under which circumstances i can use it ? Please advise. |
|
#4
|
|||
|
|||
|
its a matter of preference i would say and its up to u to decide what u want to use
|
|
#5
|
||||
|
||||
|
single quotes won't interpret variables...
so: $var = "hello"; print '$var'; print "$var"; The first line prints the variable name, the second line would print the value... Your example should work, except your missing a . echo "hehe ".$_REGISTER['name']". How are you"; |
|
#6
|
|||
|
|||
|
i believe it should be
echo "hehe ".$_REGISTER['name']." How are you"; not echo "hehe ".$_REGISTER['name']". How are you"; |
|
#7
|
||||
|
||||
|
Bruski,
You're right, I didn't notice... Looks like I copied the line from Alicia's post and forgot to make that change. Thanks for the correction |
|
#8
|
|||
|
|||
|
np ... =]
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > parse error doubt |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|