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
Here is an alternative, you can take advantage of php array (no preg_match needed or XML):
You can start by spliting it per line
Then you save it as key pair value in an array
Now you can access anyline like so
and so on. I hope this is what you are looking for