Array () elements?.

  • Hello,

    I've been learning HTML, CSS and PHP for about a month. So I am a newbie in these fields and have to ask, thanks in advance.

    Question: How can I determine an element from an array, so that I can save the element eg in a variable in order to access the array contents later in the code with the help of the variables.


    1. $ navi_array = array ();
    2. $ navi_array ['home'] = "home.txt";
    3. $ navi_array ['help'] = "help.txt";

    Now I want the variable $ navi_var to store the element 'home' as string:


    1. $ navi_var = "home";

    so that I can later access the array using the variable:


    1. $ var_two = $ navi_array [$ navi_var]