[SOLVED] saving data from one array into another

This is a discussion on "[SOLVED] saving data from one array into another" within the PHP Forum section. This forum, and the thread "[SOLVED] saving data from one array into another are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Nov 7th, 2007, 09:22
Up'n'Coming Member
Join Date: Oct 2007
Location: london
Age: 25
Posts: 88
Thanks: 0
Thanked 0 Times in 0 Posts
Exclamation [SOLVED] saving data from one array into another

Hi im trying to output some data from one array that has been looped through into another so i can do some further calculations. But I dont know which function to use... Can anyone help??

PHP: Select all

                // calculate all page requests
                
$all_request count($log_request); // calculate all page counts value
                
                //calculate dirty page counts

            
                
foreach ($log_request as $temp)
                {
                
$last substr($temp, -33);
                    if (
$last == "gif|| $last == "jpg" || $last == "txt" || $last == "swf|| $last == "png|| $last == "css|| $last == "/^.js/" || $last == "ico"){
                        echo 
"i have found bad data $temp<br/>";// need to save this out to $badrequest
                        
}
                    else {
                            echo 
" i have NOT found bad data $temp<br/>";
                            }
                                        
                }
                
// calculate actual page count value
                //$good_request = $all_request - $bad_request;
                
                //echo "$good_request"; 
Thanks in advance!
Reply With Quote

  #2 (permalink)  
Old Nov 7th, 2007, 09:28
Rakuli's Avatar
SuperMember

SuperMember
Join Date: Sep 2007
Location: Australia
Age: 24
Posts: 956
Blog Entries: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Re: saving data from one array into another

I don't think I understand.. You already seem to be using foreach which would acheive your goal..
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
Reply With Quote
  #3 (permalink)  
Old Nov 7th, 2007, 09:34
Up'n'Coming Member
Join Date: Oct 2007
Location: london
Age: 25
Posts: 88
Thanks: 0
Thanked 0 Times in 0 Posts
Re: saving data from one array into another

lol. yer if ixed it almost as soon as i posted it! I will mark it as solved! thanks.
Reply With Quote
Reply

Thread Tools

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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Saving values from checkboxes into MySql karinne PHP Forum 7 Jan 26th, 2008 16:58
[SOLVED] select from array in drop down box saltedm8 PHP Forum 6 Dec 3rd, 2007 21:08
[SOLVED] Array code help longstand PHP Forum 3 Dec 1st, 2007 15:14
[SOLVED] Array sorting welshstew Classic ASP 6 Nov 28th, 2007 16:45
[SOLVED] array woes eon201 PHP Forum 1 Nov 6th, 2007 15:13


All times are GMT. The time now is 20:39.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43