Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding <XML> tag at top of array to XML conversion #30

Open
adevapp opened this issue Jun 28, 2015 · 5 comments
Open

adding <XML> tag at top of array to XML conversion #30

adevapp opened this issue Jun 28, 2015 · 5 comments

Comments

@adevapp
Copy link

adevapp commented Jun 28, 2015

When converting an array to XML, the package seems to add an extra XML tag.

    $this->Report = array(
        "Service" => array(
            "ID" => $serviceID,

Is coming out with an XML open and close tag around the array.

How can I convert without this being added?

@johnvic
Copy link

johnvic commented Nov 26, 2015

+1

3 similar comments
@yasinkocak
Copy link

+1

@ghost
Copy link

ghost commented Jan 14, 2016

+1

@megadola
Copy link

+1

@YelzhasSagidulla
Copy link

YelzhasSagidulla commented Aug 11, 2017

I found solution:

        $formatter = Formatter::make($response, Formatter::ARR);

        $res = $formatter->toXml();

        $res = str_replace('<xml>', '', $res);
        $res = str_replace('</xml>', '', $res);

Now $res contains response without xml tags

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants