$arg = ilUtil::escapeShellArg("Hello world!"); exec("echo $arg", $output); var_dump($output); // Prints array(1) { [0]=> string(13) "Hello world!" }
$arg = ilUtil::escapeShellArg("Hello & world"); exec("echo $arg", $output); var_dump($output); // Prints array(1) { [0]=> string(12) "Hello & world" }In this example, we use ilUtil escapeShellArg to escape the string "Hello & world" which contains a special character (&). We then use the exec function to run the "echo" command with the escaped string as an argument. The output should be an array with a single string element containing the original string with the special character escaped as "&". This function is part of the ILIAS software package library.