I have a very complicated long text, and I want to extract the text via PHP in the windows command prompt.
My script runs fine, but I'm having trouble with this character: ^&|<>
Example:
D:\>php -r "echo 'Hello!';"
Hello!
D:\>php -r "echo \"Hello!\";"
Hello!
D:\>php -r "echo '^';" // Fine
D:\>php -r "echo \"^\";" // Error: without any error message
D:\>php -r "echo \"\^\";" // Error
PHP Parse error: syntax error, unexpected end of file, expecting variable (T_VARIABLE) or ${ (T_DOLLAR_OPEN_CURLY_BRACES) or {$ (T_CURLY_OPEN) in Command line code on line 1
Parse error: syntax error, unexpected end of file, expecting variable (T_VARIABLE) or ${ (T_DOLLAR_OPEN_CURLY_BRACES) or {$ (T_CURLY_OPEN) in Command line code on line 1
*The script runs fine if I wrap this character with single quotes, But I need to wrap this character with escaped double quotes
How to print out these characters?