No shiznatz, i really mean taking a string and using it in a function as if it was an array.. Let's say i've got about 20 values stacked in an array and i want to merge them all, so basically i have to type all the arrays like array_merge_recursive($arr[1],$arr[2],$arr[3]... etc).
Is there a way to use a for loop so that i can integrate all arrays into the recursive function without having to type $arr[1], $arr[2] etc. A for loop would be nice to be able to use for filling out that function..
I probably didn't give a good example but if i have about 20 arrays and add about 20 arrays i have to remember that i also have to update the recursive function. It would be easier if i could loop through the array and put it in as a string or something so that i only have to change either 1 or 2 values instead of adding 20 to the function.. Hope this clarifies a little more what i want though..
Oh by the way the values i've given are fictional in the arrays the actual arrays i'm merging are multidimensional arrays and consists of about 100-200 values each.
Ok for an example here we go: I'm using magpiers to subtract some RSS files, however my limited knowledge (for now) of how it exactly works makes me retrieve RSS files from an array. So basically what i do is as follows: I store links in an array and basically call the RSS function from magpiers for every single http request. It looks something like this:
Code: Select all
$rss_array[0]='hxxp://xxx.telegraaf.nl/rss/';
$rss_array[1]='hxxp://xxx.nieuws.nl/rss/';
$maxurl=2;
for ($i=0;$i<$maxurl;$i++)
{
$rss[$i] = fetch_rss($rss_array[$i]);
}
$result=array_merge_recursive($rss[0],$rss[1]);
So basically i create different arrays with $rss[$i] if i add more arrays like $rss_array[] then i have to add them to the recursive function too.. That's exactly what i want to prevent because i know how many $rss[] arrays there will be created because $maxurl = 2 (this will actually end up like 15 or 20) so i want to avoid to have to type $rss[2], $rss[3],$rss[4] in the recursive function everytime i add an URL..
Eventually i will ofcourse be able to inject/adjust the magpiers program to create just one array without having to merge multiple arrays...
Hope this really helps to get you the right idea..
