Connecting Tech Pros Worldwide Help | Site Map

Array Help

 
LinkBack Thread Tools Search this Thread
  #1  
Old March 14th, 2008, 04:45 PM
Damodhar
Guest
 
Posts: n/a
Default Array Help

HI any one help me to solve the solution



one array having the values like

$array1 = array(1,2,3,4);

$array2 = array(A,B,C,D);


i want to create the new array array using the array1 and array2

like :
$ans = array(1,A,2,B,3,C,4,D)


how can i create the new array is there any predefined functions or
any ???

  #2  
Old March 14th, 2008, 05:15 PM
Alred Wallace
Guest
 
Posts: n/a
Default Re: Array Help


"Damodhar" <damu.be@gmail.coma écrit dans le message de news:
5860b5e3-c196-424b-8f58-72fea657dd1f...oglegroups.com...
Quote:
HI any one help me to solve the solution
>
>
>
one array having the values like
>
$array1 = array(1,2,3,4);
>
$array2 = array(A,B,C,D);
>
>
i want to create the new array array using the array1 and array2
>
like :
$ans = array(1,A,2,B,3,C,4,D)
>
>
how can i create the new array is there any predefined functions or
any ???

$newArray = array();
for( $i=0;$i<count( $array1 ); $i++ ){
$newArray[] = array1[$i];
$newArray[] = array2[$i];
}


  #3  
Old March 14th, 2008, 05:15 PM
Guillaume
Guest
 
Posts: n/a
Default Re: Array Help

Damodhar a écrit :
Quote:
one array having the values like
>
$array1 = array(1,2,3,4);
>
$array2 = array(A,B,C,D);
>
>
i want to create the new array array using the array1 and array2
>
like :
$ans = array(1,A,2,B,3,C,4,D)
http://www.php.net/array_merge

Regards,
--
Guillaume
  #4  
Old March 14th, 2008, 10:15 PM
Damodhar
Guest
 
Posts: n/a
Default Re: Array Help

hi Alred Wallace,

thanks for your code wonderful,

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.