<?php
// your code goes here
$result = preg_match('/^([NSWE])(\d\d?).(\d\d?).(\d\d?(?:[.,]\d+)?).$/u', "W8°25′52.134″", $arr);
PD9waHAKCi8vIHlvdXIgY29kZSBnb2VzIGhlcmUKJGFyciA9IGFycmF5KCk7CiRyZXN1bHQgPSBwcmVnX21hdGNoKCcvXihbTlNXRV0pKFxkXGQ/KS4oXGRcZD8pLihcZFxkPyg/OlsuLF1cZCspPykuJC91JywgIlc4wrAyNeKAsjUyLjEzNOKAsyIsICRhcnIpOwp2YXJfZHVtcCgkcmVzdWx0KTsKcHJpbnRfcigkYXJyKTs=