Input | SoloLearn: Learn to code for FREE!

+4

Input

aren't we supposed to have something like cin>> in PHP?

4/23/2018 7:28:07 PM

Ms. N

4 Answers

New Answer

+3

you cannot retrieve input directly in php since php is processed on the web even before you get to see it.Unlike other languages here which demand inputs first,then compile later on sololearns server,php has to run once rather you use html forms,and get the info from those forms with $_get[] or $_post[]

+3

http://php.net/manual/en/features.commandline.io-streams.php

+3

Damyan Petkov that has to do with reading files not input,but since files can also be used as input no problem,but if youlld have to receive input from a user,files are useless,youll need a form,lets not confuse the two😇

+2

you can read php input like that file_get_contents('php://input') I used this to read json data push to the php