dcsimg
www.webdeveloper.com
Results 1 to 2 of 2

Thread: unable to renumber the array keys

  1. #1
    Join Date
    Sep 2013
    Posts
    2

    unable to renumber the array keys

    i am getting array output as:

    Code:
    Array ( [0] => Array ( [0] => 000000 [1] => 000400 [2] => 000450 ) ) Array ( [0] => Array ( [0] => 000350 [1] => 000400 ) )
    i want output like this:

    Code:
    Array ( [0] => Array ( [0] => 000000 [1] => 000400 [2] => 000450 ) ) Array ( [1] => Array ( [0] => 000350 [1] => 000400 ) )
    my php code is:

    Code:
    $select = mysql_query("SELECT ac_no, cust_name, GROUP_CONCAT(install_amt SEPARATOR ',') as installamt FROM ankali_slabpay  WHERE agent_id=$agent_id GROUP BY ac_no");
    while($row1 = mysql_fetch_array($select)){
    $a = $row1['installamt'];
    $outerARR = explode(" ", $a);
    $arr = array();
    foreach ($outerARR as $arrvalue){
        $innerarr = explode(",", $arrvalue);
        $arr[] = $innerarr;
    }
    print_r($arr);
    }

  2. #2
    Join Date
    Mar 2007
    Location
    localhost
    Posts
    2,941
    So what is your array before your output? and not using "Dump" values helps more than the "Dump" itself.
    STOP using $ prefix on JavaScript variable names...
    Please remember to wrap any code you have in forum tags:-

    [CODE]...[/CODE] [HTML]...[/HTML] [PHP]...[/PHP]

    If you can't think outside the box, you will be trapped forever with no escape...

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles