Hi! First of all Im a C# dev and has't used PHP for a couple of years now. But PHP is mostly used as a server-side script, you can use a command-promt but this is rare in PHP. (PHP has a strong association to C, so most devs create librarys in C instead)
What Im trying to say is that you don't need a terminator, looking at your code you don't seem to create an RIA application. If you are, you "need" to use a JavaScript to find the terminator and then submit the numbers to the server, but JavaScript can do all you want to do. But I will show you the basic code to get you going. (Im not adding code for your operations like max and min)
This code will take the numbers in a string divided by a comma, you can change this to a space as well if you wish.
$delimiter = ','
$numbers = explode($delimiter, $_POST['number']);
You can find the documentation of the explode function at
php.net wich takes an string and break it into an Array. The first argument is the char that divides the numbers. But I still Think you should do all this in jQuery or in another JavaScript library.