marvy
Gebruiker
- Lid geworden
- 25 dec 2000
- Berichten
- 396
De volgende code werkt dus niet ( letterlijk gecopieerd uit ebook )
<?php
echo "Hello there. So I hear you're learning to be a PHP programmer!\n";
echo "Why don't you type in your name for me:\n";
$name = trim(fgets(STDIN));
echo "\nThanks, " . $name . ", it's really nice to meet you.\n\n";
?>
Geeft alsresultaat:
Hello there. So I hear you're learning to be a PHP programmer! Why don't you type in your name for me:
( ! ) Notice: Use of undefined constant STDIN - assumed 'STDIN' in C:\wamp\www\index.php on line 5
Call Stack
# Time Memory Function Location
1 0.0005 669368 {main}( ) ..\index.php:0
( ! ) Warning: fgets() expects parameter 1 to be resource, string given in C:\wamp\www\index.php on line 5
Call Stack
# Time Memory Function Location
1 0.0005 669368 {main}( ) ..\index.php:0
2 0.0007 669712 fgets ( ) ..\index.php:5
Thanks, , it's really nice to meet you.
<?php
echo "Hello there. So I hear you're learning to be a PHP programmer!\n";
echo "Why don't you type in your name for me:\n";
$name = trim(fgets(STDIN));
echo "\nThanks, " . $name . ", it's really nice to meet you.\n\n";
?>
Geeft alsresultaat:
Hello there. So I hear you're learning to be a PHP programmer! Why don't you type in your name for me:
( ! ) Notice: Use of undefined constant STDIN - assumed 'STDIN' in C:\wamp\www\index.php on line 5
Call Stack
# Time Memory Function Location
1 0.0005 669368 {main}( ) ..\index.php:0
( ! ) Warning: fgets() expects parameter 1 to be resource, string given in C:\wamp\www\index.php on line 5
Call Stack
# Time Memory Function Location
1 0.0005 669368 {main}( ) ..\index.php:0
2 0.0007 669712 fgets ( ) ..\index.php:5
Thanks, , it's really nice to meet you.