Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8572625
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T19:03:48+00:00 2026-06-11T19:03:48+00:00

I am using an API from the book website biblio, after inputting the parameters

  • 0

I am using an API from the book website biblio, after inputting the parameters and querying a book I get a normal string returned, for some reason they do not return the string in an xml format, My question… is there a simple way to convert plain string to xml in php?

plain string example

Book ID: 524072799
Author: George R. R. Martin
Title: A Song of Ice and Fire, 7 Volumes 
Description: Harper Voyager, 2012. New and in stock.. Paperback. New. Book. 
ISBN: 9780007477159
Publisher: Harper Voyager
Date: 2012
Currency: GBP
Price: 55.00
Bookseller: El Pinarillo Books 
Bookseller_Location: GBR
URL: http://www.biblio.com/details.php?dcx=524072799
Shipping Ground: 3.15 
Shipping Expedited: 3.95
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T19:03:49+00:00Added an answer on June 11, 2026 at 7:03 pm

    Here is an alternative, you can take advantage of php array (no preg_match needed or XML):

    // The string returned;
    $string = <<<STRING
    Book ID: 524072799
    Author: George R. R. Martin
    ......
    Shipping Ground: 3.15 
    Shipping Expedited: 3.95
    STRING;
    

    You can start by spliting it per line

    $lines = explode("\n",$string);
    

    Then you save it as key pair value in an array

    $result = array();
    foreach($lines as $line){
       list($key,value) = explode(":",$line);
       $result[trim($key)] = trim($value);
    }
    

    Now you can access anyline like so

    echo $result['Book ID']; // 524072799
    echo $result['Author']; //  George R. R. Martin
    

    and so on. I hope this is what you are looking for

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to get some data from a certain web-based api using the libcurl
Can I create Facebook account from outside the face book website (using facebook API)
I am fetching some data from a site using its API-key and some other
I am trying to download some JSON from the google book API. The URL
I'm using graph api from youtube , and i am facing some trouble .
I need to get book information from isbndb.com trough XML service using this link
I am trying to simulate linux command ls using linux api from c. Looking
While browsing I came across this blog post about using the Wikipedia API from
I am using the api twitterizer2 downloaded from http://code.google.com/p/twitterizer/downloads/list but when I try to
I am trying to call magento api using Soap from android but I am

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.