You can compare arrays with comparison operators which would take the order into account:
<?php
$numbers_chosen = "8|18|3,18|3|8,3|8|18";
$winning_numbers = "8|18|3";
// Let's get those winning numbers into an array
$winning_numbers = explode('|', $winning_numbers);
$winner = false;
$tickets = explode(',', $numbers_chosen);
foreach ($tickets as $ticket) {
$balls = explode('|', $ticket);
if ($balls == $winning_numbers) $winner = true; # This is where we compare the arrays (including order)
}
echo ($winner) ? "We have a winner" : "Try again.";
exit;
?>