Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 04-11-2009, 12:43 PM Foreach Idea
evans123's Avatar
Ultra Talker

Posts: 468
Trades: 0
Say i have some numbers in the format [100,200,300,400,500][105,205,305,405,505] stored in a variable. Is it possible to use a foreach (or whatever) to obtain the data in the first set of [] and then move onto the second set of [] for example?
evans123 is offline
Reply With Quote
View Public Profile Visit evans123's homepage!
 
 
Register now for full access!
Old 04-11-2009, 01:09 PM Re: Foreach Idea
NullPointer's Avatar
Will Code for Food

Posts: 2,815
Name: Matt
Location: Irvine, CA
Trades: 0
You're talking about two arrays correct?

PHP Code:
$arrOne = array( 100 200 300 400 500 );
$arrTwo = array( 105 205 305 405 505 );

foreach(
$arrOne as $a)
{
     
$arrTwo[] = $a;

__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
NullPointer is online now
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Old 04-11-2009, 01:28 PM Re: Foreach Idea
evans123's Avatar
Ultra Talker

Posts: 468
Trades: 0
yeah thats right cheers!
evans123 is offline
Reply With Quote
View Public Profile Visit evans123's homepage!
 
Old 04-11-2009, 06:12 PM Re: Foreach Idea
mgraphic's Avatar
Truth Seeker

Latest Blog Post:
JAMISONTUNES
Posts: 2,918
Name: Keith Marshall
Location: Connecticut
Trades: 0
Sounds like array_merge() would do the same thing.
__________________

<mgraphic /> - I don't have a solution but I admire the problem.
mgraphic is offline
Reply With Quote
View Public Profile
 
Old 04-11-2009, 11:23 PM Re: Foreach Idea
anderswc's Avatar
Super Talker

Posts: 132
Name: Will Anderson
Location: Terre Haute, IN
Trades: 0
It would probably be a bit more efficient too
__________________
Will Anderson

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
anderswc is offline
Reply With Quote
View Public Profile Visit anderswc's homepage!
 
Reply     « Reply to Foreach Idea
 

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.14843 seconds with 12 queries