Archimedees Posted December 3, 2007 Share Posted December 3, 2007 According to script below. I set flag in $arParsedLines array to false then for set flag for every $arParsedLines containing $arServerNames to true. I get errors when doing this line $arCurrentLine = $arParsedLines[$arCurrentServer]; $arCurrentLine["active"] = true; Please read script below to understand my point. $arParsedLines = read_contents_pageconf("page.conf"); //mark all lines inside $arParsedLines with active=false $i=0; $MaxParsedLines = count($arParsedLines); for($i=0; $i<$MaxParsedLines; $i++) { $arParsedLines[$i]["active"] = false; } //now mark all lines the user checked as active (active=true) //note: the lines the user checked are stored within $arLineNumbers $i=0; $nMaxServerNames = count($arServerNames); for ($i=0; $i<$nMaxServerNames; $i++) { $arCurrentServerName = $arServerNames[$i]; $arCurrentLine = $arParsedLines[$arCurrentServer]; $arCurrentLine["active"] = true; $arParsedLines[$arCurrentServerName] = $arCurrentLine; }//end for ($i=0; $i<$nLenLineNumbers; $i++) Wha is the correct way of achieving my aim??? Please help if you understand my probo. Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/79949-referencing-an-array-inside-an-array/ Share on other sites More sharing options...
MadTechie Posted December 3, 2007 Share Posted December 3, 2007 only skimmed the code.. but shouldn't $arCurrentLine = $arParsedLines[$arCurrentServer]; be $arCurrentLine = $arParsedLines[$i]; also whats the error ? Quote Link to comment https://forums.phpfreaks.com/topic/79949-referencing-an-array-inside-an-array/#findComment-404946 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.