dear all; i am developing a website for my company; i'm trying to combining php and xml together; when i try to run the page, this statement appear: Parse error: syntax error, unexpected T_STRING in /home/localhost/dataku.php on line 14 here is my problem coding according to the number mention in problem above: $xml_output .= "<nama>" . "<A XML-LINK="LINK" HREF="".$ourData->web .""/>.$ourData->nama . "</A>"</nama>\n"; i'm trying to combining my customer name with their website by using above method. But somehow it didn't work!! please help me... thanks
$xml_output .= "<nama>" . "<A XML-LINK=\"LINK\" HREF=\"".$ourData->web ."\" />".$ourData->nama."</A>\"</nama>\n"; PHP: That should work for you. You were missing a few backslashes for escaping some quotes, and forgot some quotes around "$ourData->nama". Another way it could be done that might look a little cleaner... $xml_output .= '<nama><A XML-LINK="LINK" HREF="'.$ourData->web.'" />'.$ourData->nama.'</A>"</nama>'."\n"; PHP: Using single quotes instead of double quotes around your string will allow you to use double quotes inside without escaping, simplifying things a bit. But remember, single quotes won't parse special operators inside the string, that's why at the end I have used double quotes around "\n" so that it is parsed as such.