<?php
$flightpaths = 'VIE-CAI
hav-vra
JFK-SYD';
if (!preg_match_all('~^([A-Z]{3})-([A-Z]{3})$~m', strtoupper($flightpaths), $out, PREG_SET_ORDER)) {
echo 'Invalid Entry';
} else {
foreach ($out as $row) {
echo "Destination #1: {$row[1]}\n";
echo "Destination #2: {$row[2]}\n\n";
}
}
- Output for 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.25, 8.4.1 - 8.4.12
- Destination #1: VIE
Destination #2: CAI
Destination #1: HAV
Destination #2: VRA
Destination #1: JFK
Destination #2: SYD
preferences:
132.3 ms | 408 KiB | 5 Q