Jump to content

Referencing an array inside an array


Archimedees

Recommended Posts

 

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.