www.webdeveloper.com
Results 1 to 3 of 3

Thread: Arrays

Hybrid View

  1. #1
    Join Date
    Feb 2013
    Posts
    2

    Arrays

    Hello,
    I'm trying to combine the values of two arrays. But I don't know how to do it exactly.
    I have two arrays:
    [1, 2] and [3, 4, 5]
    And I want to combine them so I can get this array: [13, 14, 15, 23, 24, 25] How I can do that?

  2. #2
    Join Date
    Apr 2010
    Posts
    88
    PHP Code:
    $array1 = array(12);
    $array2 = array(345);
    $final = array();
    foreach(
    $array1 as $a1)
            foreach(
    $array2 as $a2)
                    
    $final[] = $a1 $a2;
    print_r($final); 

  3. #3
    Join Date
    Feb 2013
    Posts
    2
    Thank you very much.

Thread Information

Users Browsing this Thread

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

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