Questions tagged [php-stream-wrappers]

PHP provides a number of miscellaneous I/O streams that allow access to PHP's own input and output streams, the standard input, output and error file descriptors, in-memory and disk-backed temporary file streams, and filters that can manipulate other file resources as they are read from and written to.

PHP provides a number of miscellaneous I/O streams that allow access to PHP's own input and output streams, the standard input, output and error file descriptors, in-memory and disk-backed temporary file streams, and filters that can manipulate other file resources as they are read from and written to.

Some of the supported streams are:

  • php://stdin,
  • php://stdout
  • php://stderr
  • php://input
  • php://output
  • php://fd
  • php://memory
  • php://temp
  • php://filter
48 questions
-1
votes
1 answer

How to determine whether a string points to a valid file or wrapper in PHP?

Say I want to tell whether a string passed to fopen represents either a file path or a valid wrapper (e.g. "/home/user/example.txt" vs "php://input"). This is for the purpose of creating a tmpfile from what's in php://input to work around fseeking…
Austin Burk
  • 930
  • 4
  • 15
  • 33
-1
votes
1 answer

php://input retrieve JSON with hebrew via POST, returns question marks

I'm using a PHP script to retrieve a JSON object sent via POST. The JSON POST request basically looks like this: POST /script.php HTTP/1.1 Host: xx.xx.xx.xx Content-Type: application/json Content-Length: xx Connection: keep-alive {var:"value",…
Miki Berkovich
  • 467
  • 5
  • 16
-2
votes
1 answer

Compare string in php file and string from cli

when I get input from cli, I var_dump it and this showed for me: string(2) "Y " So how I understand I receive the single char and the bag of blank spaces, so this code will return false ($input == "Y"). How I can solve this issue?
nowiko
  • 2,507
  • 6
  • 38
  • 82
1 2 3
4