Jump to content

thomjjames

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Contact Methods

  • Website URL
    http://codelessons.com

Profile Information

  • Gender
    Not Telling

thomjjames's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi there, thanks alot for the suggestion i have made progress as a result of it. it successfully removes the 'flexinode_' array from the main array and i made a slight change to maintain the names of the arrays. see my slightly changed version below: [code] //$old_array contains your current array $new_array = array(); $keys = array_keys($old_array); $keys = array_keys($old_array); for($i=0; $i<count($keys); $i++) {     echo "<br />". $keys[$i];          if(strpos($keys[$i],"flexinode_") === FALSE)         $new_array[$keys[$i]] .= $old_array[$keys[$i]]; } print_r($new_array); //Should display your array with the flexinode keys removed. [/code] however, i still have alittle problem with the outputting the remaining arrays in full. At present i'm getting an output of: [code] Array ( [upload_1] => Object [upload_2] => Object [upload_3] => Object [upload_4] => Object [upload_5] => Object [upload_6] => Object [upload_7] => Object ) [/code] it seems that $old_array[$i] is not picking up its value from the original array, is this because this because these values are in an object not an array? how do i go about getting this correct values out of these objects in order to recreate the array?? thanks again Tom
  2. Hi everyone, i'm alittle stuck with the array below that is produced by a session variable on my site. It seems to contain objects within the arrays, and this has really thrown me as i'm no great PHPer and i'm just going round in circles!! What i want to do is look through the array [called 'file_uploads' see below] and remove any arrays it contains that are called 'flexinode_10' or 'flexinode_something'. Then reconstruct the session variable minus the 'flexinode' arrays. Hope that makes sense. Here's an example array ['file_uploads'], the array could contain X amount of arrays, depending on how many files are uploaded. [code]Array ( //i want to keep this array [upload_1] => stdClass Object ( [filename] => ar-lgflag.gif [filemime] => image/gif [filepath] => /tmp/ar-lgflag.gif [error] => 0 [filesize] => 7053 [source] => upload_1 [list]=> 1 [_filename] => files/ar-lgflag.gif ) //i want to remove this array [flexinode_10] => stdClass Object ( [filename] => brxbxp65530.jpg [filemime] => image/jpeg [filepath] => /tmp/brxbxp65530.jpg [error] => 0 [filesize] => 20187 [source] => flexinode_10 [_filename] => files/brxbxp65530.jpg ) )[/code] Any help or a push in the right direction would be amazing, as i'm just going on trial and error and getting nowhere!!! thanks Tom
  3. Hi everyone, i was wondering if anyone out there knows how to list mySQL results in alphabetical order with each letter having its own group [probably doesn't make much sense, so...]. So for example it would look like this: [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--] A All the people whos name begins with A. B All the people whos name begins with B. C All the people whos name begins with C and so on and so on. The only way i know how to do this would be to make separate recordsets for each letter of the alphabet [abit long winded] and i was hoping someone might know how to do this with a for loop or something similar. any suggestions would be brilliant Thanks TOM
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.