Jeg vil gerne have mit output fra et blad fra min xml database til at række over flere linjer
Script
<?php
// objectet er at få ændre variablen id via adressen
$id = $_GET["id"];
echo "Id er lige nu: $id ";
if (file_exists('lala.xml')) {
$xml = simplexml_load_file('lala.xml') or die('kunne ikke loade xml fil');
echo " a1 navn : " . $xml->unique->$id->a1->navn . " "; ?> <br> <?
echo " a1 stats : " . $xml->unique->$id->a1->stats . " ";
} else {
exit('Failed to open test.xml.');
}
?>
xml
<items>
<unique>
<okse>
<a1>
<navn>LALALA</navn>
<stats>One-Hand Damage: (90.8-107.3) To (159.5-188.5)
Durability: 28
Required Dexterity: 67
Required Strength: 125
Required Level: 67
+40% Increased Attack Speed
+175-225% Enhanced damage
-33% Target's Defence
Deadly Strike 50%
Chance of Open Wounds 50%</stats>
</a1>
<a2>
<navn>Item 2</navn>
<stats>Item Stats 2</stats>
</a2>
</okse>
</unique>
</items>
Pt er output
One-Hand Damage: (90.8-107.3) To (159.5-188.5)Durability: 28Required Dexterity: 67Required Strength: 125Required Level: 67+40% Increased Attack Speed+175-225% Enhanced damage-33% Target's DefenceDeadly Strike 50%Chance of Open Wounds 50%
Vil gerne have output til at blive
One-Hand Damage: (90.8-107.3) To (159.5-188.5)
Durability: 28
Required Dexterity: 67
Required Strength: 125
Required Level: 67
+40% Increased Attack Speed
+175-225% Enhanced damage
-33% Target's Defence
Deadly Strike 50%
Chance of Open Wounds 50%
Indlæg senest redigeret d. 11.04.2007 19:56 af Bruger #8805