Jump to content

Arekanderu

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Arekanderu's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. The following is a code sample of how the XML i retrieve from a web service looks like. <?php $xmlString = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" ."<Response>" ."<Results id=\"1\" description=\"some description here\">" ."<Result foundAs=\"test\" score=\"1\" id=\"18757\" resultType=\"1\" description=\"A result\"/>" ."<Result foundAs=\"test2\" score=\"4\" id=\"45767\" resultType=\"2\" description=\"Another result\"/>" ."</Results>" ."</Response>"; $result = simplexml_load_string($xmlString); var_dump($result); ?> The above outputs the following: object(SimpleXMLElement)#1 (1) { ["Results"]=> object(SimpleXMLElement)#2 (2) { ["@attributes"]=> array(2) { ["id"]=> string(1) "1" ["description"]=> string(21) "some description here" } ["Result"]=> object(SimpleXMLElement)#3 (1) { ["@attributes"]=> array(5) { ["foundAs"]=> string(4) "test" ["score"]=> string(1) "1" ["id"]=> string(5) "18757" ["resultType"]=> string(1) "1" ["description"]=> string( "A result" } } } } Can someone help me out on how do i access the value of the e.g "foundAs" of the first Result?
  2. Ignore, next time i should read more carefully about simplexml_load_string
  3. Hello, I am using soap to communicate with the web services of a server. Everything so far so good....The return of the server however has the following format: <ELEMENTS_WRAPPER> <elementA attribute1="data_here" attribute2="data_here" attribute3="data3" /> <elementB attribute1="data_here" attribute2="data_here" attribute3="data3" /> </ELEMENTS_WRAPPER> I have searched to see if i could find a class that takes a string as xml and not a file but i wasn't happy with the results. At the moment as a work around i have created a function which through string manipulation i get the value i want between two other strings. It's a solution i do not like and i would appreciate it if someone has to suggest something else Regards
  4. Hello All! I will describe a small problem of mine and i am hoping that somebody can give me an elegant solution. [What I want to do] I am developing a PHP application which it will output at the user a small image with various objects on fixed positions on the image. The user will then be able to drag the mouse on a object, click on it and output information about it. e.g object type, sizeetc. The info for each object are stored in a MySQL db. [The question] As you understand i want to dynamically load the information for each object each time a user "clicks" on a object . What i am having trouble with is HOW am i going to put clickable stuff inside a static image ( the map ) and through PHP will be able to output some useful info to the user. In addition, the image should also be drawn dynamically since i want to show at the user which object is at the moment ocupied by being red ( this info will also be at the DB ). I know that you can do this through GDI but how am i going to do it if i want to combine it with the other thing. If my question isn't that clear or if you think i can help more understanding it please let me know. I have found couple solutions which i do not like so it would really save me some time if anyone has any suggestions. I do not mind using other stuff inside my PHP code ( e.g jscript ) in order to get where i want. Somebody did suggest me map tag of HTML but i want something more dynamic. Cheers and thanks for any replies!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.