#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Location
    India
    Posts
    5
    Rep Power
    0

    How to compare and replace values in two dimensional arrays


    Code:
    $a = array(000,400,000,500);
        $b = array(300,400,450,500);
        
        $i=0;
        foreach($b as $k=>$v)
        {
            if($v==$a[$i])
            {
                $b[$k]='000';
            }
            $i++;
        }
        
        print_r($b);
    i want same thing in two dimensional array

    $a = Array ( [0] => Array ( [0] => 000000 [1] => 000400 [2] => 000450 ) [1] => Array ( [0] => 000350 [1] => 000400 ) )

    $b = array(0=>000350,1=>000400,2=>000450) //pre-defined installment amount values
  2. #2
  3. --
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2012
    Posts
    3,957
    Rep Power
    1046
    Hi,

    what is this about? What are you trying to do?

    Give us a concrete description and not just a bunch of random numbers.
    The 6 worst sins of security ē How to (properly) access a MySQL database with PHP

    Why canít I use certain words like "drop" as part of my Security Question answers?
    There are certain words used by hackers to try to gain access to systems and manipulate data; therefore, the following words are restricted: "select," "delete," "update," "insert," "drop" and "null".

IMN logo majestic logo threadwatch logo seochat tools logo