0
在下面的代码中,在preg_match
,$videoinfo['video']['rendering']
之后绝对等于“渐进”。与php变量问题混淆
所以,我期待最后的回声输出“渲染:逐行扫描”。
但是,它没有。它输出“渲染:渐进式”我在这里丢失了一些明显的东西吗?
感谢您的帮助!
if(preg_match("/^Video Field Order\s+:(.*)$/im",$output,$matches)){
$videoinfo['video']['rendering'] = $matches[1];
if($videoinfo['video']['rendering'] == "Progressive"){
$videoinfo['video']['rendering'] = 'Progressive Scan';
}
echo("Rendering: " . $videoinfo['video']['rendering']);
}
您确定该字符串中没有任何尾随空格吗?尝试'trim($ matches [1]);' – h2ooooooo
这意味着条件不是“真”,这意味着该字符串实际上并不是“渐进式”。可能有一些额外的尾随空白左右。 – deceze
可能在“Progressive”之前或之后有额外的空间 – 2013-08-26 06:57:14