Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8415913
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T01:35:10+00:00 2026-06-10T01:35:10+00:00

I am developing a clan website: piratesofpopulous.comli.com/ It is a game’s clan website, I

  • 0

I am developing a clan website: piratesofpopulous.comli.com/
It is a game’s clan website, I wanted to get the game history of my clan members and show them on their profile page,You can see it here:

http://piratesofpopulous.comli.com/user.php?username=Waleed

That page is not published for users and I am still working on it. The problem is I used explode method to explode this page: http://www.popre.net/game.php?u=38456 . Then use the arrays where game’s were saved i.e $expl[596].

I am using this code:

//Breaking the URL
$url = "$profile_link"; <-- This profile link will be driven from the database, Its saved when user is registered.
parse_str( parse_url( $url, PHP_URL_QUERY), $params);

//After Breaking putting the value of u in function
function gameStats($u)
{
$result = file_get_contents('http://popre.net/game.php?u='. $u . '');
$expl = explode('"',$result);

echo"<br>Level: $expl[580]<br>";
echo"Players: $expl[596]<br><br>";
echo"Result: $expl[584]<br><br>";
echo"Points: $expl[586]<br><br>";
}
gameStats( $params['u']);

I am breaking the url because the users are registered using a url
like this i.e: http://www.popre.net/user.php?u=38456 <– Link
contains user.php?u=someid

But the games are saved at game.php not in user.php i.e: www.popre.net/game.php?u=38456 <– game.php/u=same_user_id

I broke the url to to get the value of “u” from their profile link and then put it in game.php to get arrays, Then show the selective arrays……

You can view all arrays by:

print_r($expl);

But the problem is that, For few mins examply the explode array $expl[596] is changed to something else containing other data i.e $expl[580], But after few more mins it changes back to $expl[596]. Then the data and games are shown correctly. You can view the page on which I am showing these here: http://piratesofpopulous.comli.com/user.php?username=Waleed I am still working on it.

So, Is there any way to get the perfect array number So the data is permanently shown without showing any other data?

Or any other method that works if the arrays are changed?

Or any thing else?

Any help would be good for me…..

EDIT:

I am doing this to get the Map(game level),Players,Result and Points.
But after sometime the explode array i.e:Player $expl[600]; changed to $expl[596],It keeps changing but after sometimes it will get back to $expl[600].Is there anyway to still get data from it while it keeeps changing?

This is my code that I am using:

            $url = "$profile_link"; <-- You can use this profile link http://popre.net/user.php?u=38456
            parse_str( parse_url( $url, PHP_URL_QUERY), $params);
            function gameStats($u)
            {
            $result = file_get_contents('http://popre.net/game.php?u='. $u . '');
            $expl = explode('"',$result);

            echo"<div id='games'>";
            echo"<h3>Game 1</h3>";
            echo"<div class='data'>Level:    $expl[584]</div><br>";
            echo"<div class='data'>Player:   $expl[600]</div><br><br>";
            echo"<div class='data'>Result:   $expl[588]</div><br><br>";
            echo"<div class='data'>Points:   $expl[590]</div><br><br></b>";
            echo"</div>";

            }
            gameStats( $params['u']);

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T01:35:11+00:00Added an answer on June 10, 2026 at 1:35 am

    You need to use preg_match_all() .

    eg: for all script

    $url = "www.popre.net/user.php?u=38456";
    parse_str( parse_url( $url, PHP_URL_QUERY), $params);
    
    function gameStats($u){
        $result = file_get_contents('http://popre.net/game.php?u='. $u . '');
        $return = array();
        $pattern = "\<td rowspan=\"2\" class=\"gamelevel\">\<span><a href=\"(.*)\">(.*)<\/a><\/span>\n(.*)<a href=\"(.*)\">(.*)<\/a><\/td>\n(.*)<td class=\"gamepointsresult dgame(.*)\">(.*)<\/td>(.*)<td class=\"gamepoints\">(.*)<\/td><td class=\"gamepoints\">(.*)<\/td><td class=\"gamepoints\">(.*)<\/td>\n(.*)<tr class=\"(one|two)\"><td colspan=\"4\" class=\"gameplayerssmall\">(.*)vs.(.*)<\/td>\<\/tr>";
        $match = preg_match_all('/'.$pattern.'/', $result, $matches);
    
        /* level */      foreach($matches[2] as $num => $one){ $return[$num]['level'] = $one; }
        /* map */        foreach($matches[5] as $num => $one){ $return[$num]['map'] = $one; }
        /* result */     foreach($matches[8] as $num => $one){ $return[$num]['result'] = $one; }
        /* points */     foreach($matches[10] as $num => $one){ $return[$num]['points'] = strip_tags($one); }
        /* mu */         foreach($matches[11] as $num => $one){ $return[$num]['mu'] = strip_tags($one); }
        /* sigma */      foreach($matches[12] as $num => $one){ $return[$num]['sigma'] = strip_tags($one); }
        /* player1 */    foreach($matches[15] as $num => $one){ $return[$num]['player1'] = strip_tags($one); }
        /* player2 */    foreach($matches[16] as $num => $one){ $return[$num]['player2'] = strip_tags($one); }
    
        return $return;
    }
    
    $gameInfo = gameStats($params['u']);
    
    echo "<table border='1'>
            <tr>
                <td>NO</td><td>LEVEL</td><td>MAP</td><td>RESULT</td><td>POINTS</td><td>MU</td><td>SIGMA</td><td>Player 1</td><td>Player 2</td>
            </tr>\n";
    
    foreach($gameInfo as $num => $one){
        echo "<tr>
            <td>".($num+1)."</td><td>".$one['level']."</td><td>".$one['map']."</td><td>".$one['result']."</td><td>".$one['points']."</td><td>".$one['mu']."</td><td>".$one['sigma']."</td><td>".$one['player1']."</td><td>".$one['player2']."</td>
        </tr>\n";
    }
    
    echo "</table>";
    

    You will get all results in that array, same for the others, then combine the array, as all results will have same number of elements in every array.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Developing a website and just trying to get back into the swing of (clever)
iam developing one application.In that i need to get the music files from the
Developing an iPad website I tried to use the CSS property overflow: auto to
Developing a game with AndEngine GLES2 I am having an issue trying to change
Developing a simple game for the iPhone, what gives a better performance? Using a
Developing a new ROR3 website, I need to implement a sort of internal mail
When developing a spotify app, how do I show a standard spotify share popover
Developing websites are time-consuming. To improve productivity, I would code a prototype to show
Developing for Android 2.3, I have a question regarding layouts. I use a vertival
Developing a project of mine I realize I have a need for some level

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.