How can PHP be used to accept user input in a similar way to C++?

To accept user input in PHP similar to how it's done in C++, you can use the `fgets(STDIN)` function to read input from the command line. This function reads a line from the standard input (stdin) and can be used to capture user input. You can then use this input in your PHP script as needed.

<?php
echo "Enter your name: ";
$name = fgets(STDIN);
echo "Hello, $name";
?>