Jump to content

Silky1284

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Silky1284's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Well it only looping until its finished with each array ID. What my script does is parses a set of ID's from each page.... then returns to the functions and parses the IDs from the next id in the array... Simple terms it acts like a "Spider". It starts from one Id.. and branches out and parses the Ids from every id thereafter. and appends the ids to the array.. well that's what im attempting.
  2. Sorry I moved on and was editing the script. I tested what I wanted to do making a new script as an example... Basically I just want to add this to my current script! But the arrays are being created by my function which will loop through each array and end. Currently for each number it is creating a new array and making an endless loop. <?php $arrayid1= array(1, 2, 3, 4, 1, 2, 3, 4); $arrayid2= array(2, 3, 4, 4, 1, 3); $arrayid3= array(3, 4, 2, 2, 3); $arrayid4= array(4, 5,); $merge = array_merge($arrayid1, $arrayid2, $arrayid3, $arrayid4); $arrayid = array_unique($merge); foreach ($arrayid as $id){ //echo $id.'<br />'; $uniqueIDs[] = $id; } for($m=0; $m<count($uniqueIDs); $m++){ echo $uniqueIDs[$m].'<br />'; } ?>
  3. OK I'm almost finished with my code but I've run into the same problem. What I'm trying to do is perform the original function used to parse each ID in the array with each ID gathered from the function into an array without repeating the id if its already in the array. Basically appending to the current array without repeating the id if its already in the array. Looking into array_push() or array_merge but not sure if that is the best way to go. Currently it is repeating in what seems to be and endless loop of the same ids repeating. Current Ouput: http://crowbarmafia.co.cc/spam/comments.php Desired Output: Madea - 427789161, Anonymous - 513386222, SlLKY - 439573355, K i L L e R X - 505686564, Suicidal Silky - 512045047 within the table. Here's an example of how the ids are set up... Example: $arrayid1= array(1, 2); $arrayid2= array(2, 3); $arrayid3= array(3, 4); $arrayid4= array(4, 5); Desired Output: [0.] => 1 [1] => 2 [2] => 3 [3] => 4 [4] => 5 $id = 513386222; $sHost = "http://api.msappspace.com/proxy/relay.proxy?opensocial_authtype=SIGNED&opensocial_token="; $sHost2 = "&opensocial_url=http%3A//mob-dynamic-lb1.mobsters06.com/mob/"; $header = file_get_contents($sHost.$myOSKey.$sHost2."get_comments%3Fuser_id%3D".$myID."%26target_id%3D".$id."%26session_id%3D".$mySESID."&nocache=1"); $commentEntery = split("<entry>", $header); for($a=1; $a<count($commentEntery); $a++){ $userID = split("<user_id>",$commentEntery[$a]); $userID = split("<", $userID[1]); $mob_name = split("<mob_name>",$commentEntery[$a]); $mob_name = split("<", $mob_name[1]); $mobnames[] = $mob_name[0]; $ids[] = $userID[0]; } $ids = array_unique($ids); $mobnames = array_unique($mobnames); foreach ($mobnames as $names){ $name[] = $names; [list][/list] } foreach ($ids as $id){ $uniqueIDs[] = $id; } for($m=0; $m<count($uniqueIDs); $m++){ $icomments = file_get_contents($sHost.$myOSKey.$sHost2."get_comments%3Fuser_id%3D".$myID."%26target_id%3D".$uniqueIDs[$m]."%26session_id%3D".$mySESID."&nocache=1"); $commentEntery = split("<entry>", $icomments); for($a=1; $a<count($commentEntery); $a++){ $userID = split("<user_id>",$commentEntery[$a]); $userID = split("<", $userID[1]); $mob_name = split("<mob_name>",$commentEntery[$a]); $mob_name = split("<", $mob_name[1]); $mobnames[] = $mob_name[0]; $ids[] = $userID[0]; } $ids = array_unique($ids); $mobnames = array_unique($mobnames); foreach ($ids as $id){ //echo $id.'<br />'; $uniqueIDs[] = $id; } foreach ($mobnames as $names){ //echo $names.'<br />'; $name[] = $names; } echo '<tr><td>'.$name[$m].'</td><td>'.$uniqueIDs[$m].'</td></tr>'."\n"; } ?>
×
×
  • 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.