To get array inputs from user

To get array inputs from user

Input:

1 2 3
5 6

Output:

N=1
K=2
P=3
5
6

PHP Implementation: