<script type="text/javascript">$(document).ready(function () {
$('#getOrder').submit(function (e) {
e.preventDefault();
$.ajax({
type: "POST",
url: 'getOrder.php',
data: $(this).serialize(),
success: response => {
alert(response);
}
});
});
});
</script>
getOrder.php:<?php
$array = array('123', '456', '789');
echo $array;
echo json_encode(array('123', '456', '789'));
let array = JSON.parse(response);