Multidimensional array search and compare, invalid argument!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
leathem
Forum Newbie
Posts: 9
Joined: Tue Sep 02, 2008 3:21 am

Multidimensional array search and compare, invalid argument!

Post by leathem »

hello all,
i have a multi dimensional array that is pulled from a config file, i want to loop through each element of the array and acompare it to another element of a xml file if it matches it displays the result. the problem is it doesn't work. it has sumthin to do with the indicated line ****

here is the code.

config.properties file
<<<<<<<<<<<<<<<<<

Code: Select all

 
groups = group1 group2
group1.projects = bla bla1 bla2
group2.projects = fla1 fla2
 
<<<<<<<<<<<<
index.php
<<<<<<<<<<<<<

Code: Select all

 
function summaryDisplay($dir_name, $filter, $rss)
{
  global $config;
  $groups = ($config["groups"]);
  $groupsArray = explode(' ', $groups);
 
  $projectsArrays = array();
  
  for($i = 0; $i < count($groupsArray); $i++)
  {
   **** $projectsArrays[$i] =  explode(' ', ($config[$groupsArray[$i] + ".projects"])); 
  }
 
Last edited by leathem on Thu Oct 09, 2008 11:03 am, edited 1 time in total.
User avatar
aceconcepts
DevNet Resident
Posts: 1424
Joined: Mon Feb 06, 2006 11:26 am
Location: London

Re: Multidimensional array search and compare, invalid argument!

Post by aceconcepts »

It's far easier for people to read your code if you place it between the code brackets.
leathem
Forum Newbie
Posts: 9
Joined: Tue Sep 02, 2008 3:21 am

Re: Multidimensional array search and compare, invalid argument!

Post by leathem »

where exactly do u mean.
User avatar
aceconcepts
DevNet Resident
Posts: 1424
Joined: Mon Feb 06, 2006 11:26 am
Location: London

Re: Multidimensional array search and compare, invalid argument!

Post by aceconcepts »

When you reply to a post click the "code" button in the editor.
leathem
Forum Newbie
Posts: 9
Joined: Tue Sep 02, 2008 3:21 am

Re: Multidimensional array search and compare, invalid argument!

Post by leathem »

cheers kid. no can u solve the problem.
leathem
Forum Newbie
Posts: 9
Joined: Tue Sep 02, 2008 3:21 am

Re: Multidimensional array search and compare, invalid argument!

Post by leathem »

didn't think so.
User avatar
aceconcepts
DevNet Resident
Posts: 1424
Joined: Mon Feb 06, 2006 11:26 am
Location: London

Re: Multidimensional array search and compare, invalid argument!

Post by aceconcepts »

Easy dude - some of have work to do!!!

I come on this forum to help people out.
Post Reply