From: Bavithra R on
hi friends..


Is there any equivalent statement in php for "scanf" or "cin" in c or c++?
That is without using html and creating forms.


Thanks in advance
regards
--Bavithra.R
From: "HallMarc Websites" on

>hi friends..


>Is there any equivalent statement in php for "scanf" or "cin" in c or c++?
>That is without using html and creating forms.


>Thanks in advance
>regards
>--Bavithra.R

No, there are no equivalents in PHP.



__________ Information from ESET Smart Security, version of virus signature
database 5314 (20100726) __________

The message was checked by ESET Smart Security.

http://www.eset.com



__________ Information from ESET Smart Security, version of virus signature
database 5314 (20100726) __________

The message was checked by ESET Smart Security.

http://www.eset.com


From: "Daevid Vincent" on
> -----Original Message-----
> From: Bavithra R [mailto:bavithra.r(a)gmail.com]
> Sent: Monday, July 26, 2010 7:39 AM
> To: php-db(a)lists.php.net
> Subject: [PHP-DB] input statement in php
>
> hi friends..
>
>
> Is there any equivalent statement in php for "scanf" or
> "cin" in c or c++?
> That is without using html and creating forms.
>
>
> Thanks in advance
> regards
> --Bavithra.R

There unfortunately isn't any scanf() but if you're trying to get user
input on a CLI, then you can either use the argv/argc options or do
something like this tutorial does.

http://www.ehow.com/how_5321606_prompt-line-interface-using-php.html

From: Richard Quadling on
On 26 July 2010 15:38, Bavithra R <bavithra.r(a)gmail.com> wrote:
> hi friends..
>
>
> Is there any equivalent statement in php  for "scanf" or "cin" in c or c++?
> That is without using html and creating forms.

WOW. Completely surprised by the two responses that were given.

<?php
while ($userinfo = fscanf(STDIN, "%s\t%s\t%s\n")) {
print_r($userinfo);
}
?>

STDIN is a predefined resource, so no need to fopen()/fclose() it.

Hope this helps.

Regards,

Richard Quadling.