I had been asked in an interview for PHP. In a PHP file index.php, there are 4 lines of code:
- Line 1 Takes input from user
- Line 2 Encrypts the User input
- Line 3 Decrypts the the Encrypted User input of line 2
- Line 4 Prints the Decrypted content of line 3
On executing this file via command prompt/terminal like php index.php, Original User input of line 1 gets printed/displayed by Line 4 in the command prompt/terminal but when opened/executed in browser the same code did not display anything.
What could be the reason ?
Please explain if anyone knows, would be helpful in future interviews if asked.