is there a way to slice a string lets say i have this variable
$output=Country=UNITED STATES (US) &City=Scottsdale, AZ &Latitude=33.686 &Longitude=-111.87
i want to slice it in a way i want to pull latitude and longitude values in to seperate variables, subtok is not serving the purpose
You don’t need a regular expression for this; use
explode()to split up the string, first by&, and then by=, which you can use to effectively parse it into a nice little array mapping names to values.