Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/EmptyTag/145.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何检查字符串是否对uudecode有效_Php_String_Uudecode - Fatal编程技术网

Php 如何检查字符串是否对uudecode有效

Php 如何检查字符串是否对uudecode有效,php,string,uudecode,Php,String,Uudecode,我想在使用“convert_uudecode”之前检查$sTring是否已编码,如果$sTring未编码,则不输出任何内容。我收到一条PHP警告:“…给定的参数不是…”中有效的未编码字符串,除非我正确编码了$string。在使用convert_uudecode之前是否需要检查$sTring,或者如果没有编码,是否需要阻止PHP警告 try{ $sTring='hello'; echo convert_uudecode($sTring); }catch(Exception $e){

我想在使用“convert_uudecode”之前检查$sTring是否已编码,如果$sTring未编码,则不输出任何内容。我收到一条PHP警告:“…给定的参数不是…”中有效的未编码字符串,除非我正确编码了$string。在使用convert_uudecode之前是否需要检查$sTring,或者如果没有编码,是否需要阻止PHP警告

try{
    $sTring='hello';
    echo convert_uudecode($sTring);
}catch(Exception $e){}

谢谢

找到了使用警告抑制'@'的方法:

if(@convert_uudecode($sTring))echo convert_uudecode($sTring);
我不打算投票给我自己的答案,希望有人能给出其他更好的答案