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