- var_dump: documentation ( source)
- get_loaded_extensions: documentation ( source)
- str_replace: documentation ( source)
- addcslashes: documentation ( source)
<?php
function escapeShellArgument( $argument )
{
$escapeChar = '"';
$argument = str_replace( $escapeChar, "\\" . $escapeChar, addcslashes( $argument, '\\' ) );
var_dump($escapeChar . $argument . $escapeChar);
}
var_dump(get_loaded_extensions());
escapeShellArgument("0ノルウェーサーモンのカルパッチョ");
escapeShellArgument("'0サーモンを薄切りにし、お\"皿に均等に並べ、塩、コショウを軽く振っておきます。");
escapeShellArgument("\"this should work!\"");