troydavisson / PHRETS

PHP client library for interacting with a RETS server to pull real estate listings, photos and other data made available from an MLS system
http://troda.com
MIT License
451 stars 236 forks source link

Possible to change the COMPACT-DECODED Delimiter? #145

Closed intrepidws closed 7 years ago

intrepidws commented 7 years ago

I'm using the COMPACT-DECODED format to pull results, but that means I'm left with field values like:

I was doing a str_replace(',', ', ', $value) after I pulled the data, but that was messing with other non-encoded fields (like VirtualTourLink).

Is it possible to change the COMPACT-DECODED Delimiter? Or is that something done by my provider?

troydavisson commented 7 years ago

The delimiter used is totally up to the RETS server you're interacting with so I'm not sure there's anything you or I can do here. There are some RETS servers that provide these kinds of values as CSV (quoted comma separated) which makes it a little easier to work with in this scenario (if you're prepared to possibly get quoted values), but it doesn't sound like this is one of them.

troydavisson commented 7 years ago

To expand on my previous comment a bit, the "best" option for understanding multiple values correctly and accurately is using COMPACT, treating the separator as you've described and then translating each value to the human-readable version yourself. This is likely what the provider will tell you is likely the best way to move forward, even though it's a small pain on the client side to do (unless your data structure already supports looking up descriptions from codes).

intrepidws commented 7 years ago

Thanks for the quick reply.

Really appreciate your work on this project.