How To Parse Ticket API Response (PHP)? NO EXAMPLES!

How To Parse Ticket API Response (PHP)? NO EXAMPLES!

I've found no examples of responses for any of the API Calls in Zoho CRM.  I had to trial and error, get the data, then figure out what format it's in to be able to parse the results.  This doesn't seem like something that would be difficult to add to the documentation and it would be an extremely helpful piece of data.

I have figured out how to parse all errors and return messages except for the Ticket response.  I can output the response and look at it but I can't use it with any functions like strpos().  When I view the source I get something like the following:

#
#Sat Oct 03 22:16:41 PDT 2009
GETUSERNAME=null
WARNING=null
PASS_EXPIRY=-1
TICKET=ea47a1c1e06exampleexamplee870d
RESULT=TRUE
1

It looks like there are line breaks so I've tried explode('\n', $results) but I only get one array item with the last data piece (1). I've also just tried using strpos to find 'TICKET' but it's not found. Apparently I'm not looking at a string variable???

What format is this response coming back in? How can I parse it? The examples I've seen are in Java, which I would think I could use the same type of functions in PHP but I haven't gotten them to work.

I see the Java example reading line by line. Is there a way to do this in PHP? I would think that exploding the string by \n \r\n \n\r or \r but it's not working. What are you using to create these lines Zoho?

Thanks,
Jared