I have the following code which gives me exactly what I first needed (uppercase words after the first = in the string $data:
if (($pos = strpos($data, "=")) !== FALSE) {
$whatIWant = ucwords(substr($data, $pos+1));
}
What I now need to do is exactly the same thing, but ignore anything after (and including) the first & in the same string ($data).
My PHP is weak, please can someone tell me how to update the above to do this? I haven't been able to find the answer here but if I've missed it please tell me.
Sample strings:
destination=Apartment+TITLIS+Resort+Wohnung+721&hotelid=0123454656
destination=Rental+Apartment+Mendi+Eder+-+Saint-Jean&hotelid=01234
destination=Three-Bedroom+Holiday+Home+in+Olofstrom&hotelid=98
$data