Need help to formating array's

Discussion in 'PHP' started by shiva_rnm, Jun 20, 2008.

  1. #1
    I have one file wit all array's...Example
    <?
    $textes = array (
    "my_cart" => "Meu carrinho",
    "your_cart_contains" => "Meu carrinho contem",
    );

    $countryList = array (
    "ALBANIA",
    "BAHAMAS",
    );

    $action_color_S = array (
    "0" => "vermelho",
    "1" => "verde",
    "2" => "laranja",
    );

    ?>


    I want to to produce the array from above file in the below format,

    $mixed = array ( "textes" => array (
    "my_cart" => "Meu carrinho",
    "your_cart_contains" => "Meu carrinho contem",
    ),
    "countryList" => array (
    "ALBANIA",
    "BAHAMAS",
    ),
    "action_color_S" => array (
    "0" => "vermelho",
    "1" => "verde",
    "2" => "laranja",
    )
    );

    I will be waiting for reply

    thanks in advance
     
    shiva_rnm, Jun 20, 2008 IP
  2. ecentricNick

    ecentricNick Peon

    Messages:
    351
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Unless I'm missing something in your question...

    $mixed= array ("textes"=>$textes, "countryList" => $countryList, "action_color_S"=>$action_colour_S);
     
    ecentricNick, Jun 20, 2008 IP
  3. shiva_rnm

    shiva_rnm Peon

    Messages:
    20
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thank you very much ecentricNick, for your answer.

    I'm now stuck wit other problem.
    I've php files which consists of (only) set of array's, as one example i have shown above. Now i want to write a function which will take out all (only) array names from a php file and assigns to array variable(which u solved it).
    taking out all array name from php file is my problem.

    Thanks in advance.
     
    shiva_rnm, Jun 20, 2008 IP