0
preg_match('|phpVersion = (.*)\n|',$wampConfFileContents,$result);
$phpVersion = str_replace('"','',$result[1]);
preg_match('|apacheVersion = (.*)\n|',$wampConfFileContents,$result);
$apacheVersion = str_replace('"','',$result[1]);
preg_match('|mysqlVersion = (.*)\n|',$wampConfFileContents,$result);
$mysqlVersion = str_replace('"','',$result[1]);
preg_match('|wampserverVersion = (.*)\n|',$wampConfFileContents,$result);
$wampserverVersion = str_replace('"','',$result[1]);
从线31至线38,我打开本地主机,所以它会给出这个错误,本地主机的颜色仍然是黄色的。我怎样才能获得绿色?我有错误:注意:未定义偏移:1 C:当瓦帕 WWW 的index.php在线路32上,在线路34上,在线路36上,线路38上
这意味着'$ result [1]'不存在(索引1)。通过'print_r($ result);'检查并看到索引1有没有? –
[PHP:“注意:未定义的变量”,“注意:未定义的索引”和“注意:未定义的偏移量”的可能的重复](https://stackoverflow.com/questions/4261133/php-notice-undefined-variable- notice-undefined-index-and-notice-undef) – Exprator
print_r($ result);现在它工作非常感谢你@AlivetoDie – Dynamo