arrays - Parsing an input separated by delimiter in PHP -
i developing php application online code judge. same, taking input passing on java server calculating output , again matching generated output desired output. works single input or output.
i want extend such multiple inputs can parsed java server , output obtained matched respective desired output.
$input = str_replace("\n", '$_n_$', treat($fields['input'])); //$fields has result of sql query fwrite($socket, $input."\n"); // write input socket
as of have input : input
1 2 3 4 5
output(in case sum)
15
this input matched expected output have already
now want is, if input :
1 2 3 4 5 # 1 3 5 7 # 1 2 6 7
i want @ once 1 input passed jave server ,then , on. inputs can separated delimiter in case have used #.
how proceed it? should use associative arrays?
Comments
Post a Comment