Hi guys, got a slight problem. I grab data from my internal system, and I need to pass it to an external system which wants it in another format. So I get a customer name like so
$strName = $_POST['customer'];
That name could be anything
John Wayne Smith
John & Smith
The system I need to pass it too requires it to be
So a firstname and a surname. If my String contains only 1 word (no surname), surname will have to be set to 000. Anything which is empty should be 000 (so if my string is completely empty, both firstname and surname would be 000). But then how could I split my String bearing in mind that the deliminator could essentially be anything?
In summary, I have one String which could be anything. How do I get this correctly into 2 Strings?
Any advice on this problem appreciated.