A background program of my server can process strings, like this: tool --text "my string, hello world"
But what if the string to be processed already contains the "
symbol? How should this parameter be passed?
For example: tool --text "my string, "hello world""
It went wrong.
Can I handle string parameters in a PHP script?
Yes, here is a solution:
$command = "tool --text " . escapeshellarg($text);