PHP5 simplexml

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • elyob

    PHP5 simplexml

    Hi guys, I'm trying to output from an XML string and am having no luck. I'm
    using PHP5 here.

    If I print_r the array I get all the results plus extra text, but am unable
    to extract the individual response. Any pointers appreciated.

    Here's the code that shows the results...

    $get_all_value = $xmlrpc_resp->value();
    $albums_array = php_xmlrpc_deco de($get_all_val ue);
    print $albums_array['string'];

    Here's the result string that I want to break up ...

    xmlrpcval Object
    (
    [me] => Array
    (
    [string] =>
    <photos page="1" pages="1" perpage="500" total="155">
    <photo id="114766115" owner="xxxxxx" secret="xxxxxx" server="50"
    title="Water Pump, Bushy Park" ispublic="1" isfriend="0" isfamily="0" />
    <photo id="114765757" owner="xxxxxx" secret="xxxxxx" server="36"
    title="Deer, Bushy Park" ispublic="1" isfriend="0" isfamily="0" /> </photos>

    )

    [mytype] => 1
    [_php_class] =>
    )Many thanks


  • elyob

    #2
    Re: PHP5 simplexml

    Hi all, I didn't get any replies on this unfoprtunately, but thought I'd
    give a second go with an error from my apache log.

    [Tue Mar 28 10:02:16 2006] [error] [client 127.0.0.1] PHP Warning:
    simplexml_load_ string() expects parameter 1 to be string, object given in
    z:\\xmlrpc.php on line 34\n

    So, how do I convert from an object to a string?!

    <crosses fingers>
    Thanks
    </crosses fingers>
    "elyob" <newsprofile@gm ail.com> wrote in message
    news:44233283$1 @news1.homechoi ce.co.uk...[color=blue]
    > Hi guys, I'm trying to output from an XML string and am having no luck.
    > I'm using PHP5 here.
    >
    > If I print_r the array I get all the results plus extra text, but am
    > unable to extract the individual response. Any pointers appreciated.
    >
    > Here's the code that shows the results...
    >
    > $get_all_value = $xmlrpc_resp->value();
    > $albums_array = php_xmlrpc_deco de($get_all_val ue);
    > print $albums_array['string'];
    >
    > Here's the result string that I want to break up ...
    >
    > xmlrpcval Object
    > (
    > [me] => Array
    > (
    > [string] =>
    > <photos page="1" pages="1" perpage="500" total="155">
    > <photo id="114766115" owner="xxxxxx" secret="xxxxxx" server="50"
    > title="Water Pump, Bushy Park" ispublic="1" isfriend="0" isfamily="0" />
    > <photo id="114765757" owner="xxxxxx" secret="xxxxxx" server="36"
    > title="Deer, Bushy Park" ispublic="1" isfriend="0" isfamily="0" />
    > </photos>
    >
    > )
    >
    > [mytype] => 1
    > [_php_class] =>
    > )Many thanks
    >[/color]


    Comment

    Working...