Skip to content
Advertisement

Reading input in php from terminal

I want to read the following input in php which is entered in termial

JavaScript

Where:

  • The first line of input consists of an integer T which is the number of test cases.
  • The first line of each test case contains an integer n which indicates the size of both arrays.
  • The second and third line of each test case contains n space separated integers which are the elements of the first and second arrays respectively.

I am new to PHP, can anybody explain me the code logic of reading the input?

I don’t want to store the input in a file and read it from there.

Any help would be appreciable, Thank you.

Advertisement

Answer

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement